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

Side by Side Diff: cc/layers/texture_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/texture_layer_impl.h" 5 #include "cc/layers/texture_layer_impl.h"
6 6
7 #include "cc/output/context_provider.h" 7 #include "cc/output/context_provider.h"
8 #include "cc/output/output_surface.h" 8 #include "cc/output/output_surface.h"
9 #include "cc/test/layer_test_common.h" 9 #include "cc/test/layer_test_common.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace cc { 12 namespace cc {
13 namespace { 13 namespace {
14 14
15 void IgnoreCallback(uint32 sync_point, bool lost) {} 15 void IgnoreCallback(uint32 sync_point, bool lost) {}
16 16
17 TEST(TextureLayerImplTest, Occlusion) { 17 TEST(TextureLayerImplTest, Occlusion) {
18 gfx::Size layer_size(1000, 1000); 18 gfx::Size layer_size(1000, 1000);
19 gfx::Size viewport_size(1000, 1000); 19 gfx::Size viewport_size(1000, 1000);
20 20
21 LayerTestCommon::LayerImplTest impl; 21 LayerTestCommon::LayerImplTest impl;
22 22
23 gpu::Mailbox mailbox; 23 gpu::Mailbox mailbox;
24 impl.output_surface()->context_provider()->ContextGL()->GenMailboxCHROMIUM( 24 impl.output_surface()->context_provider()->ContextGL()->GenMailboxCHROMIUM(
25 mailbox.name); 25 mailbox.name);
26 TextureMailbox texture_mailbox(mailbox, GL_TEXTURE_2D, 0); 26 TextureMailbox texture_mailbox(mailbox, GL_TEXTURE_2D, 0);
27 27
28 TextureLayerImpl* texture_layer_impl = 28 TextureLayerImpl* texture_layer_impl =
29 impl.AddChildToRoot<TextureLayerImpl>(); 29 impl.AddChildToRoot<TextureLayerImpl>();
30 texture_layer_impl->SetAnchorPoint(gfx::PointF()); 30 texture_layer_impl->SetTransformOrigin(gfx::Point3F());
31 texture_layer_impl->SetBounds(layer_size); 31 texture_layer_impl->SetBounds(layer_size);
32 texture_layer_impl->SetContentBounds(layer_size); 32 texture_layer_impl->SetContentBounds(layer_size);
33 texture_layer_impl->SetDrawsContent(true); 33 texture_layer_impl->SetDrawsContent(true);
34 texture_layer_impl->SetTextureMailbox( 34 texture_layer_impl->SetTextureMailbox(
35 texture_mailbox, 35 texture_mailbox,
36 SingleReleaseCallback::Create(base::Bind(&IgnoreCallback))); 36 SingleReleaseCallback::Create(base::Bind(&IgnoreCallback)));
37 37
38 impl.CalcDrawProps(viewport_size); 38 impl.CalcDrawProps(viewport_size);
39 39
40 { 40 {
(...skipping 27 matching lines...) Expand all
68 occluded, 68 occluded,
69 &partially_occluded_count); 69 &partially_occluded_count);
70 // The layer outputs one quad, which is partially occluded. 70 // The layer outputs one quad, which is partially occluded.
71 EXPECT_EQ(1u, impl.quad_list().size()); 71 EXPECT_EQ(1u, impl.quad_list().size());
72 EXPECT_EQ(1u, partially_occluded_count); 72 EXPECT_EQ(1u, partially_occluded_count);
73 } 73 }
74 } 74 }
75 75
76 } // namespace 76 } // namespace
77 } // namespace cc 77 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698