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

Side by Side Diff: cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc

Issue 308193003: Removed QuadSink and MockQuadCuller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@plumLayerImpl
Patch Set: rebase Created 6 years, 6 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/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_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/append_quads_data.h" 5 #include "cc/layers/append_quads_data.h"
6 #include "cc/layers/content_layer_client.h" 6 #include "cc/layers/content_layer_client.h"
7 #include "cc/layers/picture_layer.h" 7 #include "cc/layers/picture_layer.h"
8 #include "cc/layers/picture_layer_impl.h" 8 #include "cc/layers/picture_layer_impl.h"
9 #include "cc/quads/draw_quad.h" 9 #include "cc/quads/draw_quad.h"
10 #include "cc/test/layer_tree_pixel_test.h" 10 #include "cc/test/layer_tree_pixel_test.h"
11 #include "cc/test/mock_quad_culler.h" 11 #include "cc/test/mock_occlusion_tracker.h"
12 #include "cc/trees/layer_tree_impl.h" 12 #include "cc/trees/layer_tree_impl.h"
13 #include "third_party/skia/include/core/SkCanvas.h" 13 #include "third_party/skia/include/core/SkCanvas.h"
14 #include "third_party/skia/include/core/SkColor.h" 14 #include "third_party/skia/include/core/SkColor.h"
15 #include "ui/gfx/rect.h" 15 #include "ui/gfx/rect.h"
16 #include "ui/gfx/rect_f.h" 16 #include "ui/gfx/rect_f.h"
17 17
18 #if !defined(OS_ANDROID) 18 #if !defined(OS_ANDROID)
19 19
20 namespace cc { 20 namespace cc {
21 namespace { 21 namespace {
(...skipping 14 matching lines...) Expand all
36 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, 36 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
37 bool result) OVERRIDE { 37 bool result) OVERRIDE {
38 // Find the PictureLayerImpl ask it to append quads to check their material. 38 // Find the PictureLayerImpl ask it to append quads to check their material.
39 // The PictureLayerImpl is assumed to be the first child of the root layer 39 // The PictureLayerImpl is assumed to be the first child of the root layer
40 // in the active tree. 40 // in the active tree.
41 PictureLayerImpl* picture_layer = static_cast<PictureLayerImpl*>( 41 PictureLayerImpl* picture_layer = static_cast<PictureLayerImpl*>(
42 host_impl->active_tree()->root_layer()->child_at(0)); 42 host_impl->active_tree()->root_layer()->child_at(0));
43 43
44 MockOcclusionTracker<LayerImpl> occlusion_tracker; 44 MockOcclusionTracker<LayerImpl> occlusion_tracker;
45 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); 45 scoped_ptr<RenderPass> render_pass = RenderPass::Create();
46 MockQuadCuller quad_culler(render_pass.get(), &occlusion_tracker);
47 46
48 AppendQuadsData data; 47 AppendQuadsData data;
49 picture_layer->AppendQuads(&quad_culler, &data); 48 picture_layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
50 49
51 for (size_t i = 0; i < render_pass->quad_list.size(); ++i) 50 for (size_t i = 0; i < render_pass->quad_list.size(); ++i)
52 EXPECT_EQ(render_pass->quad_list[i]->material, DrawQuad::PICTURE_CONTENT); 51 EXPECT_EQ(render_pass->quad_list[i]->material, DrawQuad::PICTURE_CONTENT);
53 52
54 // Triggers pixel readback and ends the test. 53 // Triggers pixel readback and ends the test.
55 LayerTreePixelTest::SwapBuffersOnThread(host_impl, result); 54 LayerTreePixelTest::SwapBuffersOnThread(host_impl, result);
56 } 55 }
57 56
58 void RunOnDemandRasterPixelTest(); 57 void RunOnDemandRasterPixelTest();
59 }; 58 };
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 122
124 TEST_F(LayerTreeHostOnDemandRasterPixelTestWithGpuRasterizationForced, 123 TEST_F(LayerTreeHostOnDemandRasterPixelTestWithGpuRasterizationForced,
125 RasterPictureLayer) { 124 RasterPictureLayer) {
126 RunOnDemandRasterPixelTest(); 125 RunOnDemandRasterPixelTest();
127 } 126 }
128 127
129 } // namespace 128 } // namespace
130 } // namespace cc 129 } // namespace cc
131 130
132 #endif // OS_ANDROID 131 #endif // OS_ANDROID
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698