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

Side by Side Diff: cc/layers/tiled_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 "cc/layers/tiled_layer_impl.h" 5 #include "cc/layers/tiled_layer_impl.h"
6 6
7 #include "cc/layers/append_quads_data.h" 7 #include "cc/layers/append_quads_data.h"
8 #include "cc/quads/tile_draw_quad.h" 8 #include "cc/quads/tile_draw_quad.h"
9 #include "cc/resources/layer_tiling_data.h" 9 #include "cc/resources/layer_tiling_data.h"
10 #include "cc/test/fake_impl_proxy.h" 10 #include "cc/test/fake_impl_proxy.h"
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 } 310 }
311 311
312 TEST_F(TiledLayerImplTest, Occlusion) { 312 TEST_F(TiledLayerImplTest, Occlusion) {
313 gfx::Size tile_size(100, 100); 313 gfx::Size tile_size(100, 100);
314 gfx::Size layer_bounds(1000, 1000); 314 gfx::Size layer_bounds(1000, 1000);
315 gfx::Size viewport_size(1000, 1000); 315 gfx::Size viewport_size(1000, 1000);
316 316
317 LayerTestCommon::LayerImplTest impl; 317 LayerTestCommon::LayerImplTest impl;
318 318
319 TiledLayerImpl* tiled_layer = impl.AddChildToRoot<TiledLayerImpl>(); 319 TiledLayerImpl* tiled_layer = impl.AddChildToRoot<TiledLayerImpl>();
320 tiled_layer->SetAnchorPoint(gfx::PointF()); 320 tiled_layer->SetTransformOrigin(gfx::Point3F());
321 tiled_layer->SetBounds(layer_bounds); 321 tiled_layer->SetBounds(layer_bounds);
322 tiled_layer->SetContentBounds(layer_bounds); 322 tiled_layer->SetContentBounds(layer_bounds);
323 tiled_layer->SetDrawsContent(true); 323 tiled_layer->SetDrawsContent(true);
324 tiled_layer->set_skips_draw(false); 324 tiled_layer->set_skips_draw(false);
325 325
326 scoped_ptr<LayerTilingData> tiler = 326 scoped_ptr<LayerTilingData> tiler =
327 LayerTilingData::Create(tile_size, LayerTilingData::NO_BORDER_TEXELS); 327 LayerTilingData::Create(tile_size, LayerTilingData::NO_BORDER_TEXELS);
328 tiler->SetTilingRect(gfx::Rect(layer_bounds)); 328 tiler->SetTilingRect(gfx::Rect(layer_bounds));
329 tiled_layer->SetTilingData(*tiler); 329 tiled_layer->SetTilingData(*tiler);
330 330
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 occluded, 367 occluded,
368 &partially_occluded_count); 368 &partially_occluded_count);
369 // The layer outputs one quad, which is partially occluded. 369 // The layer outputs one quad, which is partially occluded.
370 EXPECT_EQ(100u - 10u, impl.quad_list().size()); 370 EXPECT_EQ(100u - 10u, impl.quad_list().size());
371 EXPECT_EQ(10u + 10u, partially_occluded_count); 371 EXPECT_EQ(10u + 10u, partially_occluded_count);
372 } 372 }
373 } 373 }
374 374
375 } // namespace 375 } // namespace
376 } // namespace cc 376 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698