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

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

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 5 years, 1 month 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/texture_layer_impl.cc ('k') | cc/layers/texture_layer_unittest.cc » ('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 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, 15 void IgnoreCallback(const gpu::SyncToken& sync_token,
16 bool lost, 16 bool lost,
17 BlockingTaskRunner* main_thread_task_runner) { 17 BlockingTaskRunner* main_thread_task_runner) {}
18 }
19 18
20 TEST(TextureLayerImplTest, VisibleOpaqueRegion) { 19 TEST(TextureLayerImplTest, VisibleOpaqueRegion) {
21 const gfx::Size layer_bounds(100, 100); 20 const gfx::Size layer_bounds(100, 100);
22 const gfx::Rect layer_rect(layer_bounds); 21 const gfx::Rect layer_rect(layer_bounds);
23 const Region layer_region(layer_rect); 22 const Region layer_region(layer_rect);
24 23
25 LayerTestCommon::LayerImplTest impl; 24 LayerTestCommon::LayerImplTest impl;
26 25
27 TextureLayerImpl* layer = impl.AddChildToRoot<TextureLayerImpl>(); 26 TextureLayerImpl* layer = impl.AddChildToRoot<TextureLayerImpl>();
28 layer->SetBounds(layer_bounds); 27 layer->SetBounds(layer_bounds);
(...skipping 16 matching lines...) Expand all
45 44
46 TEST(TextureLayerImplTest, Occlusion) { 45 TEST(TextureLayerImplTest, Occlusion) {
47 gfx::Size layer_size(1000, 1000); 46 gfx::Size layer_size(1000, 1000);
48 gfx::Size viewport_size(1000, 1000); 47 gfx::Size viewport_size(1000, 1000);
49 48
50 LayerTestCommon::LayerImplTest impl; 49 LayerTestCommon::LayerImplTest impl;
51 50
52 gpu::Mailbox mailbox; 51 gpu::Mailbox mailbox;
53 impl.output_surface()->context_provider()->ContextGL()->GenMailboxCHROMIUM( 52 impl.output_surface()->context_provider()->ContextGL()->GenMailboxCHROMIUM(
54 mailbox.name); 53 mailbox.name);
55 TextureMailbox texture_mailbox(mailbox, GL_TEXTURE_2D, 0); 54 TextureMailbox texture_mailbox(mailbox, gpu::SyncToken(), GL_TEXTURE_2D);
56 55
57 TextureLayerImpl* texture_layer_impl = 56 TextureLayerImpl* texture_layer_impl =
58 impl.AddChildToRoot<TextureLayerImpl>(); 57 impl.AddChildToRoot<TextureLayerImpl>();
59 texture_layer_impl->SetBounds(layer_size); 58 texture_layer_impl->SetBounds(layer_size);
60 texture_layer_impl->SetDrawsContent(true); 59 texture_layer_impl->SetDrawsContent(true);
61 texture_layer_impl->SetTextureMailbox( 60 texture_layer_impl->SetTextureMailbox(
62 texture_mailbox, 61 texture_mailbox,
63 SingleReleaseCallbackImpl::Create(base::Bind(&IgnoreCallback))); 62 SingleReleaseCallbackImpl::Create(base::Bind(&IgnoreCallback)));
64 63
65 impl.CalcDrawProps(viewport_size); 64 impl.CalcDrawProps(viewport_size);
(...skipping 26 matching lines...) Expand all
92 LayerTestCommon::VerifyQuadsAreOccluded( 91 LayerTestCommon::VerifyQuadsAreOccluded(
93 impl.quad_list(), occluded, &partially_occluded_count); 92 impl.quad_list(), occluded, &partially_occluded_count);
94 // The layer outputs one quad, which is partially occluded. 93 // The layer outputs one quad, which is partially occluded.
95 EXPECT_EQ(1u, impl.quad_list().size()); 94 EXPECT_EQ(1u, impl.quad_list().size());
96 EXPECT_EQ(1u, partially_occluded_count); 95 EXPECT_EQ(1u, partially_occluded_count);
97 } 96 }
98 } 97 }
99 98
100 } // namespace 99 } // namespace
101 } // namespace cc 100 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/texture_layer_impl.cc ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698