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

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

Issue 1508223005: Client side display item cache flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 4 years, 12 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 "platform/graphics/paint/PaintArtifactToSkCanvas.h" 5 #include "platform/graphics/paint/PaintArtifactToSkCanvas.h"
6 6
7 #include "platform/graphics/paint/DisplayItem.h" 7 #include "platform/graphics/paint/DisplayItem.h"
8 #include "platform/graphics/paint/DrawingDisplayItem.h" 8 #include "platform/graphics/paint/DrawingDisplayItem.h"
9 #include "platform/graphics/paint/PaintArtifact.h" 9 #include "platform/graphics/paint/PaintArtifact.h"
10 #include "platform/transforms/TransformationMatrix.h" 10 #include "platform/transforms/TransformationMatrix.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 class DummyRectClient : public DisplayItemClient { 63 class DummyRectClient : public DisplayItemClient {
64 public: 64 public:
65 DummyRectClient(const SkRect& rect, SkColor color) : m_rect(rect), m_color(c olor) {} 65 DummyRectClient(const SkRect& rect, SkColor color) : m_rect(rect), m_color(c olor) {}
66 const SkRect& rect() const { return m_rect; } 66 const SkRect& rect() const { return m_rect; }
67 SkColor color() const { return m_color; } 67 SkColor color() const { return m_color; }
68 PassRefPtr<SkPicture> makePicture() const { return pictureWithRect(m_rect, m _color); } 68 PassRefPtr<SkPicture> makePicture() const { return pictureWithRect(m_rect, m _color); }
69 String debugName() const final { return "<dummy>"; } 69 String debugName() const final { return "<dummy>"; }
70 IntRect visualRect() const override { return IntRect(); } 70 IntRect visualRect() const override { return IntRect(); }
71 71
72 private: 72 private:
73 DISPLAY_ITEM_CACHE_STATUS_UNCACHEABLE_IMPLEMENTATION
73 SkRect m_rect; 74 SkRect m_rect;
74 SkColor m_color; 75 SkColor m_color;
75 }; 76 };
76 77
77 TEST(PaintArtifactToSkCanvasTest, Empty) 78 TEST(PaintArtifactToSkCanvasTest, Empty)
78 { 79 {
79 MockCanvas canvas(kCanvasWidth, kCanvasHeight); 80 MockCanvas canvas(kCanvasWidth, kCanvasHeight);
80 EXPECT_CALL(canvas, onDrawRect(_, _, _)).Times(0); 81 EXPECT_CALL(canvas, onDrawRect(_, _, _)).Times(0);
81 82
82 PaintArtifact artifact; 83 PaintArtifact artifact;
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 totalClip.setRect(SkIRect::MakeXYWH(100, 100, 100, 100)); 285 totalClip.setRect(SkIRect::MakeXYWH(100, 100, 100, 100));
285 totalClip.op(SkIRect::MakeXYWH(150, 150, 100, 100), SkRegion::kIntersect_Op) ; 286 totalClip.op(SkIRect::MakeXYWH(150, 150, 100, 100), SkRegion::kIntersect_Op) ;
286 EXPECT_CALL(canvas, onDrawRect(client1.rect(), Property(&SkPaint::getColor, client1.color()), 287 EXPECT_CALL(canvas, onDrawRect(client1.rect(), Property(&SkPaint::getColor, client1.color()),
287 ResultOf(&getCanvasClipAsRegion, Eq(totalClip)))); 288 ResultOf(&getCanvasClipAsRegion, Eq(totalClip))));
288 289
289 paintArtifactToSkCanvas(artifact, &canvas); 290 paintArtifactToSkCanvas(artifact, &canvas);
290 } 291 }
291 292
292 } // namespace 293 } // namespace
293 } // namespace blink 294 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698