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

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

Issue 2452483002: Move GpuMemoryBufferManager and SharedBitmapManager to CompositorFrameSink (Closed)
Patch Set: rebase Created 4 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
« no previous file with comments | « cc/layers/layer_utils_unittest.cc ('k') | cc/layers/picture_layer_impl_perftest.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 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "cc/layers/append_quads_data.h" 7 #include "cc/layers/append_quads_data.h"
8 #include "cc/layers/nine_patch_layer_impl.h" 8 #include "cc/layers/nine_patch_layer_impl.h"
9 #include "cc/quads/texture_draw_quad.h" 9 #include "cc/quads/texture_draw_quad.h"
10 #include "cc/resources/ui_resource_bitmap.h" 10 #include "cc/resources/ui_resource_bitmap.h"
(...skipping 26 matching lines...) Expand all
37 const gfx::Rect& border, 37 const gfx::Rect& border,
38 bool fill_center, 38 bool fill_center,
39 size_t expected_quad_size) { 39 size_t expected_quad_size) {
40 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); 40 std::unique_ptr<RenderPass> render_pass = RenderPass::Create();
41 gfx::Rect visible_layer_rect(layer_size); 41 gfx::Rect visible_layer_rect(layer_size);
42 gfx::Rect expected_remaining(border.x(), border.y(), 42 gfx::Rect expected_remaining(border.x(), border.y(),
43 layer_size.width() - border.width(), 43 layer_size.width() - border.width(),
44 layer_size.height() - border.height()); 44 layer_size.height() - border.height());
45 45
46 FakeImplTaskRunnerProvider task_runner_provider; 46 FakeImplTaskRunnerProvider task_runner_provider;
47 TestSharedBitmapManager shared_bitmap_manager;
48 TestTaskGraphRunner task_graph_runner; 47 TestTaskGraphRunner task_graph_runner;
49 std::unique_ptr<CompositorFrameSink> compositor_frame_sink = 48 std::unique_ptr<CompositorFrameSink> compositor_frame_sink =
50 FakeCompositorFrameSink::Create3d(); 49 FakeCompositorFrameSink::Create3d();
51 FakeUIResourceLayerTreeHostImpl host_impl( 50 FakeUIResourceLayerTreeHostImpl host_impl(&task_runner_provider,
52 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); 51 &task_graph_runner);
53 host_impl.SetVisible(true); 52 host_impl.SetVisible(true);
54 host_impl.InitializeRenderer(compositor_frame_sink.get()); 53 host_impl.InitializeRenderer(compositor_frame_sink.get());
55 54
56 std::unique_ptr<NinePatchLayerImpl> layer = 55 std::unique_ptr<NinePatchLayerImpl> layer =
57 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); 56 NinePatchLayerImpl::Create(host_impl.active_tree(), 1);
58 layer->draw_properties().visible_layer_rect = visible_layer_rect; 57 layer->draw_properties().visible_layer_rect = visible_layer_rect;
59 layer->SetBounds(layer_size); 58 layer->SetBounds(layer_size);
60 layer->test_properties()->force_render_surface = true; 59 layer->test_properties()->force_render_surface = true;
61 60
62 UIResourceId uid = 1; 61 UIResourceId uid = 1;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 int image_remaining_left = border_left * ratio_left, 141 int image_remaining_left = border_left * ratio_left,
143 image_remaining_top = border_top * ratio_top, 142 image_remaining_top = border_top * ratio_top,
144 image_remaining_right = border_right * ratio_right, 143 image_remaining_right = border_right * ratio_right,
145 image_remaining_bottom = border_bottom * ratio_bottom; 144 image_remaining_bottom = border_bottom * ratio_bottom;
146 gfx::Rect expected_tex_remaining( 145 gfx::Rect expected_tex_remaining(
147 image_remaining_left, image_remaining_top, 146 image_remaining_left, image_remaining_top,
148 bitmap_size.width() - image_remaining_right - image_remaining_left, 147 bitmap_size.width() - image_remaining_right - image_remaining_left,
149 bitmap_size.height() - image_remaining_bottom - image_remaining_top); 148 bitmap_size.height() - image_remaining_bottom - image_remaining_top);
150 149
151 FakeImplTaskRunnerProvider task_runner_provider; 150 FakeImplTaskRunnerProvider task_runner_provider;
152 TestSharedBitmapManager shared_bitmap_manager;
153 TestTaskGraphRunner task_graph_runner; 151 TestTaskGraphRunner task_graph_runner;
154 std::unique_ptr<CompositorFrameSink> compositor_frame_sink = 152 std::unique_ptr<CompositorFrameSink> compositor_frame_sink =
155 FakeCompositorFrameSink::Create3d(); 153 FakeCompositorFrameSink::Create3d();
156 FakeUIResourceLayerTreeHostImpl host_impl( 154 FakeUIResourceLayerTreeHostImpl host_impl(&task_runner_provider,
157 &task_runner_provider, &shared_bitmap_manager, &task_graph_runner); 155 &task_graph_runner);
158 host_impl.SetVisible(true); 156 host_impl.SetVisible(true);
159 host_impl.InitializeRenderer(compositor_frame_sink.get()); 157 host_impl.InitializeRenderer(compositor_frame_sink.get());
160 158
161 std::unique_ptr<NinePatchLayerImpl> layer = 159 std::unique_ptr<NinePatchLayerImpl> layer =
162 NinePatchLayerImpl::Create(host_impl.active_tree(), 1); 160 NinePatchLayerImpl::Create(host_impl.active_tree(), 1);
163 layer->draw_properties().visible_layer_rect = visible_layer_rect; 161 layer->draw_properties().visible_layer_rect = visible_layer_rect;
164 layer->SetBounds(layer_size); 162 layer->SetBounds(layer_size);
165 layer->test_properties()->force_render_surface = true; 163 layer->test_properties()->force_render_surface = true;
166 164
167 UIResourceId uid = 1; 165 UIResourceId uid = 1;
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 448
451 const QuadList &quad_list = impl.quad_list(); 449 const QuadList &quad_list = impl.quad_list();
452 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); 450 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin();
453 it != quad_list.BackToFrontEnd(); ++it) 451 it != quad_list.BackToFrontEnd(); ++it)
454 EXPECT_TRUE(it->ShouldDrawWithBlending()); 452 EXPECT_TRUE(it->ShouldDrawWithBlending());
455 } 453 }
456 } 454 }
457 455
458 } // namespace 456 } // namespace
459 } // namespace cc 457 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_utils_unittest.cc ('k') | cc/layers/picture_layer_impl_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698