Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/ClipPathDisplayItem.cpp

Issue 1394313002: Make DisplayItem::replay const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "config.h" 5 #include "config.h"
6 #include "platform/graphics/paint/ClipPathDisplayItem.h" 6 #include "platform/graphics/paint/ClipPathDisplayItem.h"
7 7
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/Path.h" 9 #include "platform/graphics/Path.h"
10 #include "public/platform/WebDisplayItemList.h" 10 #include "public/platform/WebDisplayItemList.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) 15 void BeginClipPathDisplayItem::replay(GraphicsContext& context) const
16 { 16 {
17 context.save(); 17 context.save();
18 context.clipPath(m_clipPath, AntiAliased); 18 context.clipPath(m_clipPath, AntiAliased);
19 } 19 }
20 20
21 void BeginClipPathDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* li st) const 21 void BeginClipPathDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* li st) const
22 { 22 {
23 list->appendClipPathItem(m_clipPath, SkRegion::kIntersect_Op, true); 23 list->appendClipPathItem(m_clipPath, SkRegion::kIntersect_Op, true);
24 } 24 }
25 25
26 void EndClipPathDisplayItem::replay(GraphicsContext& context) 26 void EndClipPathDisplayItem::replay(GraphicsContext& context) const
27 { 27 {
28 context.restore(); 28 context.restore();
29 } 29 }
30 30
31 void EndClipPathDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* list ) const 31 void EndClipPathDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* list ) const
32 { 32 {
33 list->appendEndClipPathItem(); 33 list->appendEndClipPathItem();
34 } 34 }
35 35
36 #ifndef NDEBUG 36 #ifndef NDEBUG
37 void BeginClipPathDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& s tringBuilder) const 37 void BeginClipPathDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& s tringBuilder) const
38 { 38 {
39 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); 39 DisplayItem::dumpPropertiesAsDebugString(stringBuilder);
40 stringBuilder.append(WTF::String::format(", pathVerbs: %d, pathPoints: %d, w indRule: \"%s\"", 40 stringBuilder.append(WTF::String::format(", pathVerbs: %d, pathPoints: %d, w indRule: \"%s\"",
41 m_clipPath.countVerbs(), m_clipPath.countPoints(), 41 m_clipPath.countVerbs(), m_clipPath.countPoints(),
42 m_clipPath.getFillType() == SkPath::kWinding_FillType ? "nonzero" : "eve nodd")); 42 m_clipPath.getFillType() == SkPath::kWinding_FillType ? "nonzero" : "eve nodd"));
43 } 43 }
44 44
45 #endif 45 #endif
46 46
47 } // namespace blink 47 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698