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

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

Issue 145313006: [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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/ui_resource_layer_impl.cc ('k') | cc/output/copy_output_request.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/append_quads_data.h" 5 #include "cc/layers/append_quads_data.h"
6 #include "cc/layers/ui_resource_layer_impl.h" 6 #include "cc/layers/ui_resource_layer_impl.h"
7 #include "cc/resources/ui_resource_bitmap.h" 7 #include "cc/resources/ui_resource_bitmap.h"
8 #include "cc/resources/ui_resource_client.h" 8 #include "cc/resources/ui_resource_client.h"
9 #include "cc/test/fake_impl_proxy.h" 9 #include "cc/test/fake_impl_proxy.h"
10 #include "cc/test/fake_layer_tree_host_impl.h" 10 #include "cc/test/fake_layer_tree_host_impl.h"
11 #include "cc/test/fake_ui_resource_layer_tree_host_impl.h" 11 #include "cc/test/fake_ui_resource_layer_tree_host_impl.h"
12 #include "cc/test/layer_test_common.h" 12 #include "cc/test/layer_test_common.h"
13 #include "cc/test/mock_quad_culler.h" 13 #include "cc/test/mock_quad_culler.h"
14 #include "cc/trees/single_thread_proxy.h" 14 #include "cc/trees/single_thread_proxy.h"
15 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 #include "ui/gfx/transform.h" 17 #include "ui/gfx/transform.h"
18 18
19 namespace cc { 19 namespace cc {
20 namespace { 20 namespace {
21 21
22 scoped_ptr<UIResourceLayerImpl> GenerateUIResourceLayer( 22 scoped_ptr<UIResourceLayerImpl> GenerateUIResourceLayer(
23 FakeUIResourceLayerTreeHostImpl* host_impl, 23 FakeUIResourceLayerTreeHostImpl* host_impl,
24 gfx::Size bitmap_size, 24 const gfx::Size& bitmap_size,
25 gfx::Size layer_size, 25 const gfx::Size& layer_size,
26 bool opaque, 26 bool opaque,
27 UIResourceId uid) { 27 UIResourceId uid) {
28 gfx::Rect visible_content_rect(layer_size); 28 gfx::Rect visible_content_rect(layer_size);
29 scoped_ptr<UIResourceLayerImpl> layer = 29 scoped_ptr<UIResourceLayerImpl> layer =
30 UIResourceLayerImpl::Create(host_impl->active_tree(), 1); 30 UIResourceLayerImpl::Create(host_impl->active_tree(), 1);
31 layer->draw_properties().visible_content_rect = visible_content_rect; 31 layer->draw_properties().visible_content_rect = visible_content_rect;
32 layer->SetBounds(layer_size); 32 layer->SetBounds(layer_size);
33 layer->SetContentBounds(layer_size); 33 layer->SetContentBounds(layer_size);
34 layer->CreateRenderSurface(); 34 layer->CreateRenderSurface();
35 layer->draw_properties().render_target = layer.get(); 35 layer->draw_properties().render_target = layer.get();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 layer = GenerateUIResourceLayer( 144 layer = GenerateUIResourceLayer(
145 &host_impl, bitmap_size, layer_size, skbitmap_opaque, uid); 145 &host_impl, bitmap_size, layer_size, skbitmap_opaque, uid);
146 layer->SetContentsOpaque(true); 146 layer->SetContentsOpaque(true);
147 expected_opaque_bounds = gfx::Rect(layer->bounds()); 147 expected_opaque_bounds = gfx::Rect(layer->bounds());
148 OpaqueBoundsTest(layer.Pass(), expected_opaque_bounds); 148 OpaqueBoundsTest(layer.Pass(), expected_opaque_bounds);
149 } 149 }
150 150
151 } // namespace 151 } // namespace
152 } // namespace cc 152 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/ui_resource_layer_impl.cc ('k') | cc/output/copy_output_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698