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

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

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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/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"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 UIResourceId uid = 1; 56 UIResourceId uid = 1;
57 bool is_opaque = false; 57 bool is_opaque = false;
58 UIResourceBitmap bitmap(bitmap_size, is_opaque); 58 UIResourceBitmap bitmap(bitmap_size, is_opaque);
59 59
60 host_impl.CreateUIResource(uid, bitmap); 60 host_impl.CreateUIResource(uid, bitmap);
61 layer->SetUIResourceId(uid); 61 layer->SetUIResourceId(uid);
62 layer->SetImageBounds(bitmap_size); 62 layer->SetImageBounds(bitmap_size);
63 layer->SetLayout(aperture_rect, border, fill_center); 63 layer->SetLayout(aperture_rect, border, fill_center);
64 AppendQuadsData data; 64 AppendQuadsData data;
65 layer->AppendQuads(render_pass.get(), Occlusion(), &data); 65 layer->AppendQuads(render_pass.get(), &data);
66 66
67 // Verify quad rects 67 // Verify quad rects
68 const QuadList& quads = render_pass->quad_list; 68 const QuadList& quads = render_pass->quad_list;
69 EXPECT_EQ(expected_quad_size, quads.size()); 69 EXPECT_EQ(expected_quad_size, quads.size());
70 70
71 Region remaining(visible_content_rect); 71 Region remaining(visible_content_rect);
72 for (auto iter = quads.cbegin(); iter != quads.cend(); ++iter) { 72 for (auto iter = quads.cbegin(); iter != quads.cend(); ++iter) {
73 gfx::Rect quad_rect = iter->rect; 73 gfx::Rect quad_rect = iter->rect;
74 74
75 EXPECT_TRUE(visible_content_rect.Contains(quad_rect)) << iter.index(); 75 EXPECT_TRUE(visible_content_rect.Contains(quad_rect)) << iter.index();
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 331
332 const QuadList &quad_list = impl.quad_list(); 332 const QuadList &quad_list = impl.quad_list();
333 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); 333 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin();
334 it != quad_list.BackToFrontEnd(); ++it) 334 it != quad_list.BackToFrontEnd(); ++it)
335 EXPECT_TRUE(it->ShouldDrawWithBlending()); 335 EXPECT_TRUE(it->ShouldDrawWithBlending());
336 } 336 }
337 } 337 }
338 338
339 } // namespace 339 } // namespace
340 } // namespace cc 340 } // 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