| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/graphics/paint/ClipPathDisplayItem.h" | 5 #include "platform/graphics/paint/ClipPathDisplayItem.h" |
| 6 | 6 |
| 7 #include "platform/graphics/GraphicsContext.h" | 7 #include "platform/graphics/GraphicsContext.h" |
| 8 #include "platform/graphics/Path.h" | 8 #include "platform/graphics/Path.h" |
| 9 #include "public/platform/WebDisplayItemList.h" | 9 #include "public/platform/WebDisplayItemList.h" |
| 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" | 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" |
| 11 #include "third_party/skia/include/core/SkScalar.h" | 11 #include "third_party/skia/include/core/SkScalar.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 void BeginClipPathDisplayItem::replay(GraphicsContext& context) const { | 15 void BeginClipPathDisplayItem::replay(GraphicsContext& context) const { |
| 16 context.save(); | 16 context.save(); |
| 17 context.clipPath(m_clipPath, AntiAliased); | 17 context.clipPath(m_clipPath, AntiAliased); |
| 18 } | 18 } |
| 19 | 19 |
| 20 void BeginClipPathDisplayItem::appendToWebDisplayItemList( | 20 void BeginClipPathDisplayItem::appendToWebDisplayItemList( |
| 21 const IntRect& visualRect, | 21 const IntRect& visualRect, |
| 22 WebDisplayItemList* list) const { | 22 WebDisplayItemList* list) const { |
| 23 list->appendClipPathItem(m_clipPath, kIntersect_SkClipOp, true); | 23 list->appendClipPathItem(m_clipPath, SkClipOp::kIntersect, true); |
| 24 } | 24 } |
| 25 | 25 |
| 26 void BeginClipPathDisplayItem::analyzeForGpuRasterization( | 26 void BeginClipPathDisplayItem::analyzeForGpuRasterization( |
| 27 SkPictureGpuAnalyzer& analyzer) const { | 27 SkPictureGpuAnalyzer& analyzer) const { |
| 28 // Temporarily disabled (pref regressions due to GPU veto stickiness: | 28 // Temporarily disabled (pref regressions due to GPU veto stickiness: |
| 29 // http://crbug.com/603969). | 29 // http://crbug.com/603969). |
| 30 // analyzer.analyzeClipPath(m_clipPath, SkRegion::kIntersect_Op, true); | 30 // analyzer.analyzeClipPath(m_clipPath, SkRegion::kIntersect_Op, true); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void EndClipPathDisplayItem::replay(GraphicsContext& context) const { | 33 void EndClipPathDisplayItem::replay(GraphicsContext& context) const { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 47 stringBuilder.append(WTF::String::format( | 47 stringBuilder.append(WTF::String::format( |
| 48 ", pathVerbs: %d, pathPoints: %d, windRule: \"%s\"", | 48 ", pathVerbs: %d, pathPoints: %d, windRule: \"%s\"", |
| 49 m_clipPath.countVerbs(), m_clipPath.countPoints(), | 49 m_clipPath.countVerbs(), m_clipPath.countPoints(), |
| 50 m_clipPath.getFillType() == SkPath::kWinding_FillType ? "nonzero" | 50 m_clipPath.getFillType() == SkPath::kWinding_FillType ? "nonzero" |
| 51 : "evenodd")); | 51 : "evenodd")); |
| 52 } | 52 } |
| 53 | 53 |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 } // namespace blink | 56 } // namespace blink |
| OLD | NEW |