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

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

Issue 13863015: Add flag for drawing layers to screen with Ganesh (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again Created 7 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 | Annotate | Revision Log
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/output/gl_renderer.h » ('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 <utility> 7 #include <utility>
8 8
9 #include "cc/layers/append_quads_data.h" 9 #include "cc/layers/append_quads_data.h"
10 #include "cc/layers/picture_layer.h" 10 #include "cc/layers/picture_layer.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 active_pile->RemoveRecordingAt(0, 0); 161 active_pile->RemoveRecordingAt(0, 0);
162 active_pile->AddRecordingAt(0, 0); 162 active_pile->AddRecordingAt(0, 0);
163 163
164 SkBitmap store; 164 SkBitmap store;
165 store.setConfig(SkBitmap::kNo_Config, 1000, 1000); 165 store.setConfig(SkBitmap::kNo_Config, 1000, 1000);
166 SkDevice device(store); 166 SkDevice device(store);
167 167
168 std::vector<SkRect>::const_iterator rect_iter = rects.begin(); 168 std::vector<SkRect>::const_iterator rect_iter = rects.begin();
169 for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) { 169 for (tile_iter = tiles.begin(); tile_iter < tiles.end(); tile_iter++) {
170 MockCanvas mock_canvas(&device); 170 MockCanvas mock_canvas(&device);
171 active_pile->Raster(&mock_canvas, 171 active_pile->RasterDirect(
172 (*tile_iter)->content_rect(), 172 &mock_canvas, (*tile_iter)->content_rect(), 1.0f, NULL);
173 1.0f,
174 NULL);
175 173
176 // This test verifies that when drawing the contents of a specific tile 174 // This test verifies that when drawing the contents of a specific tile
177 // at content scale 1.0, the playback canvas never receives content from 175 // at content scale 1.0, the playback canvas never receives content from
178 // neighboring tiles which indicates that the tile grid embedded in 176 // neighboring tiles which indicates that the tile grid embedded in
179 // SkPicture is perfectly aligned with the compositor's tiles. 177 // SkPicture is perfectly aligned with the compositor's tiles.
180 // Note: There are two rects: the initial clear and the explicitly 178 EXPECT_EQ(1u, mock_canvas.rects_.size());
181 // recorded rect. We only care about the second one. 179 EXPECT_RECT_EQ(*rect_iter, mock_canvas.rects_[0]);
182 EXPECT_EQ(2u, mock_canvas.rects_.size());
183 EXPECT_RECT_EQ(*rect_iter, mock_canvas.rects_[1]);
184 rect_iter++; 180 rect_iter++;
185 } 181 }
186 } 182 }
187 183
188 FakeImplProxy proxy_; 184 FakeImplProxy proxy_;
189 FakeLayerTreeHostImpl host_impl_; 185 FakeLayerTreeHostImpl host_impl_;
190 int id_; 186 int id_;
191 FakePictureLayerImpl* pending_layer_; 187 FakePictureLayerImpl* pending_layer_;
192 FakePictureLayerImpl* active_layer_; 188 FakePictureLayerImpl* active_layer_;
193 189
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 AppendQuadsData data; 801 AppendQuadsData data;
806 data.allow_tile_draw_quads = false; 802 data.allow_tile_draw_quads = false;
807 active_layer_->AppendQuads(&quad_culler, &data); 803 active_layer_->AppendQuads(&quad_culler, &data);
808 804
809 ASSERT_EQ(1U, quad_culler.quad_list().size()); 805 ASSERT_EQ(1U, quad_culler.quad_list().size());
810 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, quad_culler.quad_list()[0]->material); 806 EXPECT_EQ(DrawQuad::PICTURE_CONTENT, quad_culler.quad_list()[0]->material);
811 } 807 }
812 808
813 } // namespace 809 } // namespace
814 } // namespace cc 810 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698