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

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

Issue 295193002: Get rid of graphics layer anchor points, and replace with transform origin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 6 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 | Annotate | Revision Log
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 SkBitmap sk_bitmap; 222 SkBitmap sk_bitmap;
223 sk_bitmap.allocN32Pixels(10, 10); 223 sk_bitmap.allocN32Pixels(10, 10);
224 sk_bitmap.setImmutable(); 224 sk_bitmap.setImmutable();
225 UIResourceId uid = 5; 225 UIResourceId uid = 5;
226 UIResourceBitmap bitmap(sk_bitmap); 226 UIResourceBitmap bitmap(sk_bitmap);
227 impl.host_impl()->CreateUIResource(uid, bitmap); 227 impl.host_impl()->CreateUIResource(uid, bitmap);
228 228
229 NinePatchLayerImpl* nine_patch_layer_impl = 229 NinePatchLayerImpl* nine_patch_layer_impl =
230 impl.AddChildToRoot<NinePatchLayerImpl>(); 230 impl.AddChildToRoot<NinePatchLayerImpl>();
231 nine_patch_layer_impl->SetAnchorPoint(gfx::PointF()); 231 nine_patch_layer_impl->SetTransformOrigin(gfx::Point3F());
232 nine_patch_layer_impl->SetBounds(layer_size); 232 nine_patch_layer_impl->SetBounds(layer_size);
233 nine_patch_layer_impl->SetContentBounds(layer_size); 233 nine_patch_layer_impl->SetContentBounds(layer_size);
234 nine_patch_layer_impl->SetDrawsContent(true); 234 nine_patch_layer_impl->SetDrawsContent(true);
235 nine_patch_layer_impl->SetUIResourceId(uid); 235 nine_patch_layer_impl->SetUIResourceId(uid);
236 nine_patch_layer_impl->SetImageBounds(gfx::Size(10, 10)); 236 nine_patch_layer_impl->SetImageBounds(gfx::Size(10, 10));
237 237
238 gfx::Rect aperture = gfx::Rect(3, 3, 4, 4); 238 gfx::Rect aperture = gfx::Rect(3, 3, 4, 4);
239 gfx::Rect border = gfx::Rect(300, 300, 400, 400); 239 gfx::Rect border = gfx::Rect(300, 300, 400, 400);
240 nine_patch_layer_impl->SetLayout(aperture, border, true); 240 nine_patch_layer_impl->SetLayout(aperture, border, true);
241 241
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 &partially_occluded_count); 273 &partially_occluded_count);
274 // The layer outputs nine quads, three of which are partially occluded, and 274 // The layer outputs nine quads, three of which are partially occluded, and
275 // three fully occluded. 275 // three fully occluded.
276 EXPECT_EQ(6u, impl.quad_list().size()); 276 EXPECT_EQ(6u, impl.quad_list().size());
277 EXPECT_EQ(3u, partially_occluded_count); 277 EXPECT_EQ(3u, partially_occluded_count);
278 } 278 }
279 } 279 }
280 280
281 } // namespace 281 } // namespace
282 } // namespace cc 282 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698