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

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

Issue 2894093002: Don't access DisplayItemClient::VisualRect() for cached display items. (Closed)
Patch Set: - Created 3 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/FloatClipDisplayItem.h" 5 #include "platform/graphics/paint/FloatClipDisplayItem.h"
6 6
7 #include "platform/graphics/GraphicsContext.h" 7 #include "platform/graphics/GraphicsContext.h"
8 #include "public/platform/WebDisplayItemList.h" 8 #include "public/platform/WebDisplayItemList.h"
9 #include "third_party/skia/include/core/SkScalar.h" 9 #include "third_party/skia/include/core/SkScalar.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 void FloatClipDisplayItem::Replay(GraphicsContext& context) const { 13 void FloatClipDisplayItem::Replay(GraphicsContext& context) const {
14 context.Save(); 14 context.Save();
15 context.Clip(clip_rect_); 15 context.Clip(clip_rect_);
16 } 16 }
17 17
18 void FloatClipDisplayItem::AppendToWebDisplayItemList( 18 void FloatClipDisplayItem::AppendToWebDisplayItemList(
19 const IntRect& visual_rect, 19 const LayoutSize&,
20 WebDisplayItemList* list) const { 20 WebDisplayItemList* list) const {
21 list->AppendFloatClipItem(clip_rect_); 21 list->AppendFloatClipItem(clip_rect_);
22 } 22 }
23 23
24 void EndFloatClipDisplayItem::Replay(GraphicsContext& context) const { 24 void EndFloatClipDisplayItem::Replay(GraphicsContext& context) const {
25 context.Restore(); 25 context.Restore();
26 } 26 }
27 27
28 void EndFloatClipDisplayItem::AppendToWebDisplayItemList( 28 void EndFloatClipDisplayItem::AppendToWebDisplayItemList(
29 const IntRect& visual_rect, 29 const LayoutSize&,
30 WebDisplayItemList* list) const { 30 WebDisplayItemList* list) const {
31 list->AppendEndFloatClipItem(); 31 list->AppendEndFloatClipItem();
32 } 32 }
33 33
34 #ifndef NDEBUG 34 #ifndef NDEBUG
35 void FloatClipDisplayItem::DumpPropertiesAsDebugString( 35 void FloatClipDisplayItem::DumpPropertiesAsDebugString(
36 WTF::StringBuilder& string_builder) const { 36 WTF::StringBuilder& string_builder) const {
37 DisplayItem::DumpPropertiesAsDebugString(string_builder); 37 DisplayItem::DumpPropertiesAsDebugString(string_builder);
38 string_builder.Append(WTF::String::Format( 38 string_builder.Append(WTF::String::Format(
39 ", floatClipRect: [%f,%f,%f,%f]}", clip_rect_.X(), clip_rect_.Y(), 39 ", floatClipRect: [%f,%f,%f,%f]}", clip_rect_.X(), clip_rect_.Y(),
40 clip_rect_.Width(), clip_rect_.Height())); 40 clip_rect_.Width(), clip_rect_.Height()));
41 } 41 }
42 42
43 #endif 43 #endif
44 44
45 } // namespace blink 45 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698