OLD | NEW |
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/base/region.h" | 5 #include "cc/base/region.h" |
6 #include "cc/base/scoped_ptr_vector.h" | 6 #include "cc/base/scoped_ptr_vector.h" |
7 #include "cc/output/compositor_frame_metadata.h" | 7 #include "cc/output/compositor_frame_metadata.h" |
8 #include "cc/output/gl_renderer.h" | 8 #include "cc/output/gl_renderer.h" |
9 #include "cc/output/output_surface.h" | 9 #include "cc/output/output_surface.h" |
10 #include "cc/output/output_surface_client.h" | 10 #include "cc/output/output_surface_client.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 gfx::Transform(0.9f, 0, 0, 0.8f, 0.1f, 0.2f); // x,y -> x,y. | 46 gfx::Transform(0.9f, 0, 0, 0.8f, 0.1f, 0.2f); // x,y -> x,y. |
47 const gfx::Transform kXMirrorTransform = | 47 const gfx::Transform kXMirrorTransform = |
48 gfx::Transform(-0.9f, 0, 0, 0.8f, 1.0f, 0.2f); // x,y -> 1-x,y. | 48 gfx::Transform(-0.9f, 0, 0, 0.8f, 1.0f, 0.2f); // x,y -> 1-x,y. |
49 const gfx::Transform kYMirrorTransform = | 49 const gfx::Transform kYMirrorTransform = |
50 gfx::Transform(0.9f, 0, 0, -0.8f, 0.1f, 1.0f); // x,y -> x,1-y. | 50 gfx::Transform(0.9f, 0, 0, -0.8f, 0.1f, 1.0f); // x,y -> x,1-y. |
51 const gfx::Transform kBothMirrorTransform = | 51 const gfx::Transform kBothMirrorTransform = |
52 gfx::Transform(-0.9f, 0, 0, -0.8f, 1.0f, 1.0f); // x,y -> 1-x,1-y. | 52 gfx::Transform(-0.9f, 0, 0, -0.8f, 1.0f, 1.0f); // x,y -> 1-x,1-y. |
53 const gfx::Transform kSwapTransform = | 53 const gfx::Transform kSwapTransform = |
54 gfx::Transform(0, 1, 1, 0, 0, 0); // x,y -> y,x. | 54 gfx::Transform(0, 1, 1, 0, 0, 0); // x,y -> y,x. |
55 | 55 |
56 void MailboxReleased(unsigned sync_point, | 56 void MailboxReleased(const gpu::SyncToken& sync_token, |
57 bool lost_resource, | 57 bool lost_resource, |
58 BlockingTaskRunner* main_thread_task_runner) { | 58 BlockingTaskRunner* main_thread_task_runner) {} |
59 } | |
60 | 59 |
61 class SingleOverlayValidator : public OverlayCandidateValidator { | 60 class SingleOverlayValidator : public OverlayCandidateValidator { |
62 public: | 61 public: |
63 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { | 62 void GetStrategies(OverlayProcessor::StrategyList* strategies) override { |
64 strategies->push_back( | 63 strategies->push_back( |
65 make_scoped_ptr(new OverlayStrategySingleOnTop(this))); | 64 make_scoped_ptr(new OverlayStrategySingleOnTop(this))); |
66 strategies->push_back(make_scoped_ptr(new OverlayStrategyUnderlay(this))); | 65 strategies->push_back(make_scoped_ptr(new OverlayStrategyUnderlay(this))); |
67 } | 66 } |
68 void CheckOverlaySupport(OverlayCandidateList* surfaces) override { | 67 void CheckOverlaySupport(OverlayCandidateList* surfaces) override { |
69 // We may have 1 or 2 surfaces depending on whether this ran through the | 68 // We may have 1 or 2 surfaces depending on whether this ran through the |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 has_transparent_background); | 198 has_transparent_background); |
200 | 199 |
201 SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState(); | 200 SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState(); |
202 shared_state->opacity = 1.f; | 201 shared_state->opacity = 1.f; |
203 return pass.Pass(); | 202 return pass.Pass(); |
204 } | 203 } |
205 | 204 |
206 ResourceId CreateResource(ResourceProvider* resource_provider, | 205 ResourceId CreateResource(ResourceProvider* resource_provider, |
207 const gfx::Size& size, | 206 const gfx::Size& size, |
208 bool is_overlay_candidate) { | 207 bool is_overlay_candidate) { |
209 unsigned sync_point = 0; | |
210 TextureMailbox mailbox = | 208 TextureMailbox mailbox = |
211 TextureMailbox(gpu::Mailbox::Generate(), GL_TEXTURE_2D, sync_point, size, | 209 TextureMailbox(gpu::Mailbox::Generate(), gpu::SyncToken(), GL_TEXTURE_2D, |
212 is_overlay_candidate); | 210 size, is_overlay_candidate); |
213 scoped_ptr<SingleReleaseCallbackImpl> release_callback = | 211 scoped_ptr<SingleReleaseCallbackImpl> release_callback = |
214 SingleReleaseCallbackImpl::Create(base::Bind(&MailboxReleased)); | 212 SingleReleaseCallbackImpl::Create(base::Bind(&MailboxReleased)); |
215 | 213 |
216 return resource_provider->CreateResourceFromTextureMailbox( | 214 return resource_provider->CreateResourceFromTextureMailbox( |
217 mailbox, release_callback.Pass()); | 215 mailbox, release_callback.Pass()); |
218 } | 216 } |
219 | 217 |
220 SolidColorDrawQuad* CreateSolidColorQuadAt( | 218 SolidColorDrawQuad* CreateSolidColorQuadAt( |
221 const SharedQuadState* shared_quad_state, | 219 const SharedQuadState* shared_quad_state, |
222 SkColor color, | 220 SkColor color, |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 renderer_->BeginDrawingFrame(&frame_no_overlays); | 1600 renderer_->BeginDrawingFrame(&frame_no_overlays); |
1603 renderer_->FinishDrawingFrame(&frame_no_overlays); | 1601 renderer_->FinishDrawingFrame(&frame_no_overlays); |
1604 EXPECT_TRUE(resource_provider_->InUseByConsumer(resource1)); | 1602 EXPECT_TRUE(resource_provider_->InUseByConsumer(resource1)); |
1605 SwapBuffers(); | 1603 SwapBuffers(); |
1606 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1)); | 1604 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1)); |
1607 Mock::VerifyAndClearExpectations(&scheduler_); | 1605 Mock::VerifyAndClearExpectations(&scheduler_); |
1608 } | 1606 } |
1609 | 1607 |
1610 } // namespace | 1608 } // namespace |
1611 } // namespace cc | 1609 } // namespace cc |
OLD | NEW |