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

Side by Side Diff: cc/layers/nine_patch_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/nine_patch_layer_impl.cc ('k') | cc/layers/painted_scrollbar_layer.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 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"
11 #include "cc/test/fake_impl_proxy.h" 11 #include "cc/test/fake_impl_proxy.h"
12 #include "cc/test/fake_ui_resource_layer_tree_host_impl.h" 12 #include "cc/test/fake_ui_resource_layer_tree_host_impl.h"
13 #include "cc/test/geometry_test_utils.h" 13 #include "cc/test/geometry_test_utils.h"
14 #include "cc/test/layer_test_common.h" 14 #include "cc/test/layer_test_common.h"
15 #include "cc/test/mock_quad_culler.h" 15 #include "cc/test/mock_quad_culler.h"
16 #include "cc/trees/single_thread_proxy.h" 16 #include "cc/trees/single_thread_proxy.h"
17 #include "testing/gmock/include/gmock/gmock.h" 17 #include "testing/gmock/include/gmock/gmock.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 #include "ui/gfx/rect_conversions.h" 19 #include "ui/gfx/rect_conversions.h"
20 #include "ui/gfx/safe_integer_conversions.h" 20 #include "ui/gfx/safe_integer_conversions.h"
21 #include "ui/gfx/transform.h" 21 #include "ui/gfx/transform.h"
22 22
23 namespace cc { 23 namespace cc {
24 namespace { 24 namespace {
25 25
26 gfx::Rect ToRoundedIntRect(gfx::RectF rect_f) { 26 gfx::Rect ToRoundedIntRect(const gfx::RectF& rect_f) {
27 return gfx::Rect(gfx::ToRoundedInt(rect_f.x()), 27 return gfx::Rect(gfx::ToRoundedInt(rect_f.x()),
28 gfx::ToRoundedInt(rect_f.y()), 28 gfx::ToRoundedInt(rect_f.y()),
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(gfx::Size bitmap_size, 33 void NinePatchLayerLayoutTest(gfx::Size bitmap_size,
34 gfx::Rect aperture_rect, 34 const gfx::Rect& aperture_rect,
35 gfx::Size layer_size, 35 gfx::Size layer_size,
36 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 MockQuadCuller quad_culler;
40 gfx::Rect visible_content_rect(layer_size); 40 gfx::Rect visible_content_rect(layer_size);
41 gfx::Rect expected_remaining(border.x(), 41 gfx::Rect expected_remaining(border.x(),
42 border.y(), 42 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 FakeImplProxy proxy; 46 FakeImplProxy proxy;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 NinePatchLayerLayoutTest(bitmap_size, 151 NinePatchLayerLayoutTest(bitmap_size,
152 aperture_rect, 152 aperture_rect,
153 layer_size, 153 layer_size,
154 border, 154 border,
155 fill_center, 155 fill_center,
156 expected_quad_size); 156 expected_quad_size);
157 } 157 }
158 158
159 } // namespace 159 } // namespace
160 } // namespace cc 160 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer_impl.cc ('k') | cc/layers/painted_scrollbar_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698