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

Side by Side Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: DrawingDisplayItem Created 3 years, 10 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
« no previous file with comments | « cc/layers/picture_layer.cc ('k') | cc/layers/picture_layer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/layers/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 EXPECT_TRUE(pending_layer()->expression); \ 64 EXPECT_TRUE(pending_layer()->expression); \
65 EXPECT_TRUE(active_layer()->expression); \ 65 EXPECT_TRUE(active_layer()->expression); \
66 } while (false) 66 } while (false)
67 67
68 #define EXPECT_BOTH_FALSE(expression) \ 68 #define EXPECT_BOTH_FALSE(expression) \
69 do { \ 69 do { \
70 EXPECT_FALSE(pending_layer()->expression); \ 70 EXPECT_FALSE(pending_layer()->expression); \
71 EXPECT_FALSE(active_layer()->expression); \ 71 EXPECT_FALSE(active_layer()->expression); \
72 } while (false) 72 } while (false)
73 73
74 class MockCanvas : public SkCanvas {
75 public:
76 explicit MockCanvas(int w, int h) : SkCanvas(w, h) {}
77
78 void onDrawRect(const SkRect& rect, const SkPaint& paint) override {
79 // Capture calls before SkCanvas quickReject() kicks in.
80 rects_.push_back(rect);
81 }
82
83 std::vector<SkRect> rects_;
84 };
85
86 class PictureLayerImplTest : public TestLayerTreeHostBase { 74 class PictureLayerImplTest : public TestLayerTreeHostBase {
87 public: 75 public:
88 void SetUp() override { 76 void SetUp() override {
89 TestLayerTreeHostBase::SetUp(); 77 TestLayerTreeHostBase::SetUp();
90 host_impl()->SetViewportSize(gfx::Size(10000, 10000)); 78 host_impl()->SetViewportSize(gfx::Size(10000, 10000));
91 } 79 }
92 80
93 LayerTreeSettings CreateSettings() override { 81 LayerTreeSettings CreateSettings() override {
94 LayerTreeSettings settings; 82 LayerTreeSettings settings;
95 settings.gpu_rasterization_enabled = true; 83 settings.gpu_rasterization_enabled = true;
(...skipping 4857 matching lines...) Expand 10 before | Expand all | Expand 10 after
4953 EXPECT_FLOAT_EQ(expected_contents_scale, 4941 EXPECT_FLOAT_EQ(expected_contents_scale,
4954 pending_layer_ptr->picture_layer_tiling_set() 4942 pending_layer_ptr->picture_layer_tiling_set()
4955 ->FindTilingWithResolution(HIGH_RESOLUTION) 4943 ->FindTilingWithResolution(HIGH_RESOLUTION)
4956 ->contents_scale()) 4944 ->contents_scale())
4957 << "ideal_contents_scale: " << ideal_contents_scale; 4945 << "ideal_contents_scale: " << ideal_contents_scale;
4958 } 4946 }
4959 } 4947 }
4960 4948
4961 } // namespace 4949 } // namespace
4962 } // namespace cc 4950 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer.cc ('k') | cc/layers/picture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698