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

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

Issue 306683002: MockQC stops create its own RP and MockOcclusionTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@testocclusiontracking
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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "base/containers/hash_tables.h" 5 #include "base/containers/hash_tables.h"
6 #include "cc/layers/append_quads_data.h" 6 #include "cc/layers/append_quads_data.h"
7 #include "cc/layers/nine_patch_layer_impl.h" 7 #include "cc/layers/nine_patch_layer_impl.h"
8 #include "cc/quads/texture_draw_quad.h" 8 #include "cc/quads/texture_draw_quad.h"
9 #include "cc/resources/ui_resource_bitmap.h" 9 #include "cc/resources/ui_resource_bitmap.h"
10 #include "cc/resources/ui_resource_client.h" 10 #include "cc/resources/ui_resource_client.h"
(...skipping 18 matching lines...) Expand all
29 gfx::ToRoundedInt(rect_f.width()), 29 gfx::ToRoundedInt(rect_f.width()),
30 gfx::ToRoundedInt(rect_f.height())); 30 gfx::ToRoundedInt(rect_f.height()));
31 } 31 }
32 32
33 void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size, 33 void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size,
34 const gfx::Rect& aperture_rect, 34 const gfx::Rect& aperture_rect,
35 const gfx::Size& layer_size, 35 const gfx::Size& layer_size,
36 const gfx::Rect& border, 36 const gfx::Rect& border,
37 bool fill_center, 37 bool fill_center,
38 size_t expected_quad_size) { 38 size_t expected_quad_size) {
39 MockQuadCuller quad_culler; 39 MockOcclusionTracker<LayerImpl> occlusion_tracker;
40 scoped_ptr<RenderPass> render_pass = RenderPass::Create();
41 MockQuadCuller quad_culler(render_pass.get(), &occlusion_tracker);
40 gfx::Rect visible_content_rect(layer_size); 42 gfx::Rect visible_content_rect(layer_size);
41 gfx::Rect expected_remaining(border.x(), 43 gfx::Rect expected_remaining(border.x(),
42 border.y(), 44 border.y(),
43 layer_size.width() - border.width(), 45 layer_size.width() - border.width(),
44 layer_size.height() - border.height()); 46 layer_size.height() - border.height());
45 47
46 FakeImplProxy proxy; 48 FakeImplProxy proxy;
47 TestSharedBitmapManager shared_bitmap_manager; 49 TestSharedBitmapManager shared_bitmap_manager;
48 FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager); 50 FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
49 scoped_ptr<NinePatchLayerImpl> layer = 51 scoped_ptr<NinePatchLayerImpl> layer =
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 &partially_occluded_count); 274 &partially_occluded_count);
273 // The layer outputs nine quads, three of which are partially occluded, and 275 // The layer outputs nine quads, three of which are partially occluded, and
274 // three fully occluded. 276 // three fully occluded.
275 EXPECT_EQ(6u, impl.quad_list().size()); 277 EXPECT_EQ(6u, impl.quad_list().size());
276 EXPECT_EQ(3u, partially_occluded_count); 278 EXPECT_EQ(3u, partially_occluded_count);
277 } 279 }
278 } 280 }
279 281
280 } // namespace 282 } // namespace
281 } // namespace cc 283 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/heads_up_display_layer_impl_unittest.cc ('k') | cc/layers/picture_image_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698