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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "cc/base/region.h" | 10 #include "cc/base/region.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 bool flipped = false; | 226 bool flipped = false; |
227 bool nearest_neighbor = false; | 227 bool nearest_neighbor = false; |
228 float vertex_opacity[4] = {1.0f, 1.0f, 1.0f, 1.0f}; | 228 float vertex_opacity[4] = {1.0f, 1.0f, 1.0f, 1.0f}; |
229 gfx::Size resource_size_in_pixels = gfx::Size(64, 64); | 229 gfx::Size resource_size_in_pixels = gfx::Size(64, 64); |
230 bool is_overlay_candidate = true; | 230 bool is_overlay_candidate = true; |
231 ResourceId resource_id = CreateResource( | 231 ResourceId resource_id = CreateResource( |
232 resource_provider, resource_size_in_pixels, is_overlay_candidate); | 232 resource_provider, resource_size_in_pixels, is_overlay_candidate); |
233 | 233 |
234 TextureDrawQuad* overlay_quad = | 234 TextureDrawQuad* overlay_quad = |
235 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 235 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
236 overlay_quad->SetNew(shared_quad_state, | 236 overlay_quad->SetNew(shared_quad_state, rect, rect, rect, resource_id, |
237 rect, | 237 premultiplied_alpha, kUVTopLeft, kUVBottomRight, |
238 rect, | 238 SK_ColorTRANSPARENT, vertex_opacity, flipped, |
239 rect, | 239 nearest_neighbor, false); |
240 resource_id, | |
241 premultiplied_alpha, | |
242 kUVTopLeft, | |
243 kUVBottomRight, | |
244 SK_ColorTRANSPARENT, | |
245 vertex_opacity, | |
246 flipped, | |
247 nearest_neighbor); | |
248 overlay_quad->set_resource_size_in_pixels(resource_size_in_pixels); | 240 overlay_quad->set_resource_size_in_pixels(resource_size_in_pixels); |
249 | 241 |
250 return overlay_quad; | 242 return overlay_quad; |
251 } | 243 } |
252 | 244 |
253 StreamVideoDrawQuad* CreateCandidateVideoQuadAt( | 245 StreamVideoDrawQuad* CreateCandidateVideoQuadAt( |
254 ResourceProvider* resource_provider, | 246 ResourceProvider* resource_provider, |
255 const SharedQuadState* shared_quad_state, | 247 const SharedQuadState* shared_quad_state, |
256 RenderPass* render_pass, | 248 RenderPass* render_pass, |
257 const gfx::Rect& rect, | 249 const gfx::Rect& rect, |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 | 1622 |
1631 // This completion corresponds to the third frame. | 1623 // This completion corresponds to the third frame. |
1632 SwapBuffersComplete(); | 1624 SwapBuffersComplete(); |
1633 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1)); | 1625 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource1)); |
1634 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource2)); | 1626 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource2)); |
1635 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource3)); | 1627 EXPECT_FALSE(resource_provider_->InUseByConsumer(resource3)); |
1636 } | 1628 } |
1637 | 1629 |
1638 } // namespace | 1630 } // namespace |
1639 } // namespace cc | 1631 } // namespace cc |
OLD | NEW |