From 8fed84447f0f83f36c7e083de993d4c5c0a6775f Mon Sep 17 00:00:00 2001 From: caryclark Date: Mon, 12 Dec 2016 10:27:25 -0800 Subject: sync with latest skia api The canvas clip op changed to a enum class to safeguard against a regular enum used as a bool in an overloaded interface. R=reed@google.com, dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2568193002 --- DEPS | 2 +- core/fxge/skia/fx_skia_device.cpp | 15 ++++++++------- skia/config/SkUserConfig.h | 4 ---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/DEPS b/DEPS index ce9d7a24f1..a93bd2a988 100644 --- a/DEPS +++ b/DEPS @@ -16,7 +16,7 @@ vars = { 'icu_revision': '73e24736676b4b438270fda44e5b2c83b49fdd80', 'instrumented_lib_revision': '45f5814b1543e41ea0be54c771e3840ea52cca4a', 'pdfium_tests_revision': '9d17ef47f310332ac64e78e636681d493482a409', - 'skia_revision': '76073c11040204d51dceb49cbd0b05be8e7fd0a2', + 'skia_revision': 'f44703a87f532b3f593d91605d66d52c6bbc45c9', 'tools_memory_revision': '427f10475e1a8d72424c29d00bf689122b738e5d', 'trace_event_revision': '06294c8a4a6f744ef284cd63cfe54dbf61eea290', 'v8_revision': '8e0dcfc4ac75c0bef9063bd5dec4dafaa3409b6d', diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 51379b85db..2a004836af 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -28,6 +28,7 @@ #include "third_party/base/ptr_util.h" #include "third_party/skia/include/core/SkCanvas.h" +#include "third_party/skia/include/core/SkClipOp.h" #include "third_party/skia/include/core/SkPaint.h" #include "third_party/skia/include/core/SkPath.h" #include "third_party/skia/include/core/SkShader.h" @@ -1038,7 +1039,7 @@ class SkiaState { } else { SkASSERT(Clip::kPath == m_commands[m_clipIndex]); m_pDriver->SkiaCanvas()->clipPath(m_clips[m_clipIndex], - kIntersect_SkClipOp, true); + SkClipOp::kIntersect, true); } ++m_clipIndex; } @@ -1449,7 +1450,7 @@ bool CFX_SkiaDeviceDriver::SetClip_PathFill( SkRect skClipRect = SkRect::MakeLTRB(rectf.left, rectf.bottom, rectf.right, rectf.top); DebugDrawSkiaClipRect(m_pCanvas, skClipRect); - m_pCanvas->clipRect(skClipRect, kIntersect_SkClipOp, true); + m_pCanvas->clipRect(skClipRect, SkClipOp::kIntersect, true); } #ifdef _SKIA_SUPPORT_PATHS_ @@ -1469,7 +1470,7 @@ bool CFX_SkiaDeviceDriver::SetClip_PathFill( DebugShowSkiaPath(skClipPath); if (!cached) { DebugDrawSkiaClipPath(m_pCanvas, skClipPath); - m_pCanvas->clipPath(skClipPath, kIntersect_SkClipOp, true); + m_pCanvas->clipPath(skClipPath, SkClipOp::kIntersect, true); } #ifdef _SKIA_SUPPORT_PATHS_ FX_RECT clipBox(0, 0, GetDeviceCaps(FXDC_PIXEL_WIDTH), @@ -1503,7 +1504,7 @@ bool CFX_SkiaDeviceDriver::SetClip_PathStroke( dst_path.transform(skMatrix); if (!cached) { DebugDrawSkiaClipPath(m_pCanvas, dst_path); - m_pCanvas->clipPath(dst_path, kIntersect_SkClipOp, true); + m_pCanvas->clipPath(dst_path, SkClipOp::kIntersect, true); } #ifdef _SKIA_SUPPORT_PATHS_ FX_RECT clipBox(0, 0, GetDeviceCaps(FXDC_PIXEL_WIDTH), @@ -1745,7 +1746,7 @@ bool CFX_SkiaDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern, SkColor colors[4]; m_pCanvas->save(); if (!skClip.isEmpty()) - m_pCanvas->clipPath(skClip, kIntersect_SkClipOp, true); + m_pCanvas->clipPath(skClip, SkClipOp::kIntersect, true); m_pCanvas->concat(skMatrix); while (!stream.BitStream()->IsEOF()) { uint32_t flag = stream.GetFlag(); @@ -1776,7 +1777,7 @@ bool CFX_SkiaDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern, } m_pCanvas->save(); if (!skClip.isEmpty()) - m_pCanvas->clipPath(skClip, kIntersect_SkClipOp, true); + m_pCanvas->clipPath(skClip, SkClipOp::kIntersect, true); m_pCanvas->concat(skMatrix); m_pCanvas->drawPath(skPath, paint); m_pCanvas->restore(); @@ -1915,7 +1916,7 @@ bool CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, m_pCanvas->save(); SkRect skClipRect = SkRect::MakeLTRB(pClipRect->left, pClipRect->bottom, pClipRect->right, pClipRect->top); - m_pCanvas->clipRect(skClipRect, kIntersect_SkClipOp, true); + m_pCanvas->clipRect(skClipRect, SkClipOp::kIntersect, true); void* dummy; bool result = StartDIBits(pSource, 0xFF, argb, &m, 0, dummy, blend_type); m_pCanvas->restore(); diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index 0dc2ed4c6c..2f13fda7b5 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h @@ -230,10 +230,6 @@ SK_API void SkDebugf_FileLine(const char* file, #define SK_IGNORE_GPU_DITHER #endif -#ifndef SK_SUPPORT_LEGACY_CLIPOPS_PLAIN_ENUM -# define SK_SUPPORT_LEGACY_CLIPOPS_PLAIN_ENUM -#endif - #ifndef SK_SUPPORT_LEGACY_EVAL_CUBIC #define SK_SUPPORT_LEGACY_EVAL_CUBIC #endif -- cgit v1.2.3