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

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

Issue 1425593007: Separate display item clients for negative and normal/positive z-order children (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Struct DisplayItemClient Created 5 years, 1 month 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/PaintArtifactToSkCanvas.h" 6 #include "platform/graphics/paint/PaintArtifactToSkCanvas.h"
7 7
8 #include "platform/graphics/paint/DisplayItem.h" 8 #include "platform/graphics/paint/DisplayItem.h"
9 #include "platform/graphics/paint/DrawingDisplayItem.h" 9 #include "platform/graphics/paint/DrawingDisplayItem.h"
10 #include "platform/graphics/paint/PaintArtifact.h" 10 #include "platform/graphics/paint/PaintArtifact.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 return SaveLayerStrategy::kFullLayer_SaveLayerStrategy; 58 return SaveLayerStrategy::kFullLayer_SaveLayerStrategy;
59 } 59 }
60 }; 60 };
61 61
62 class DummyRectClient { 62 class DummyRectClient {
63 public: 63 public:
64 DummyRectClient(const SkRect& rect, SkColor color) : m_rect(rect), m_color(c olor) {} 64 DummyRectClient(const SkRect& rect, SkColor color) : m_rect(rect), m_color(c olor) {}
65 const SkRect& rect() const { return m_rect; } 65 const SkRect& rect() const { return m_rect; }
66 SkColor color() const { return m_color; } 66 SkColor color() const { return m_color; }
67 PassRefPtr<SkPicture> makePicture() const { return pictureWithRect(m_rect, m _color); } 67 PassRefPtr<SkPicture> makePicture() const { return pictureWithRect(m_rect, m _color); }
68 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } 68 DisplayItemClient displayItemClient() const { return DisplayItemClient(this) ; }
69 String debugName() const { return "<dummy>"; } 69 String debugName() const { return "<dummy>"; }
70 70
71 private: 71 private:
72 SkRect m_rect; 72 SkRect m_rect;
73 SkColor m_color; 73 SkColor m_color;
74 }; 74 };
75 75
76 TEST(PaintArtifactToSkCanvasTest, Empty) 76 TEST(PaintArtifactToSkCanvasTest, Empty)
77 { 77 {
78 MockCanvas canvas(kCanvasWidth, kCanvasHeight); 78 MockCanvas canvas(kCanvasWidth, kCanvasHeight);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 client2, DisplayItem::DrawingFirst, client2.makePicture()); 236 client2, DisplayItem::DrawingFirst, client2.makePicture());
237 PaintChunk chunk2(1, 2, PaintChunkProperties()); 237 PaintChunk chunk2(1, 2, PaintChunkProperties());
238 chunk2.properties.effect = opacityEffectD.get(); 238 chunk2.properties.effect = opacityEffectD.get();
239 artifact.paintChunks().append(chunk2); 239 artifact.paintChunks().append(chunk2);
240 240
241 paintArtifactToSkCanvas(artifact, &canvas); 241 paintArtifactToSkCanvas(artifact, &canvas);
242 } 242 }
243 243
244 } // namespace 244 } // namespace
245 } // namespace blink 245 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698