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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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/tiled_layer_unittest.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"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 uid = 0; 82 uid = 0;
83 layer = GenerateUIResourceLayer(&host_impl, 83 layer = GenerateUIResourceLayer(&host_impl,
84 bitmap_size, 84 bitmap_size,
85 layer_size, 85 layer_size,
86 opaque, 86 opaque,
87 uid); 87 uid);
88 QuadSizeTest(layer.Pass(), expected_quad_size); 88 QuadSizeTest(layer.Pass(), expected_quad_size);
89 } 89 }
90 90
91 void OpaqueBoundsTest(scoped_ptr<UIResourceLayerImpl> layer, 91 void OpaqueBoundsTest(scoped_ptr<UIResourceLayerImpl> layer,
92 gfx::Rect expected_opaque_bounds) { 92 const gfx::Rect& expected_opaque_bounds) {
93 MockQuadCuller quad_culler; 93 MockQuadCuller quad_culler;
94 AppendQuadsData data; 94 AppendQuadsData data;
95 layer->AppendQuads(&quad_culler, &data); 95 layer->AppendQuads(&quad_culler, &data);
96 96
97 // Verify quad rects 97 // Verify quad rects
98 const QuadList& quads = quad_culler.quad_list(); 98 const QuadList& quads = quad_culler.quad_list();
99 EXPECT_GE(quads.size(), (size_t)0); 99 EXPECT_GE(quads.size(), (size_t)0);
100 gfx::Rect opaque_rect = quads.at(0)->opaque_rect; 100 gfx::Rect opaque_rect = quads.at(0)->opaque_rect;
101 EXPECT_EQ(expected_opaque_bounds, opaque_rect); 101 EXPECT_EQ(expected_opaque_bounds, opaque_rect);
102 } 102 }
(...skipping 40 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/tiled_layer_unittest.cc ('k') | cc/output/copy_output_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698