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

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

Issue 110683002: Split the hole punching logic from GOOGLE_TV ifdef to VIDEO_HOLE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years 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
« no previous file with comments | « build/common.gypi ('k') | cc/resources/video_resource_updater.h » ('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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/video_layer_impl.h" 5 #include "cc/layers/video_layer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "cc/layers/quad_sink.h" 9 #include "cc/layers/quad_sink.h"
10 #include "cc/layers/video_frame_provider_client_impl.h" 10 #include "cc/layers/video_frame_provider_client_impl.h"
11 #include "cc/quads/io_surface_draw_quad.h" 11 #include "cc/quads/io_surface_draw_quad.h"
12 #include "cc/quads/stream_video_draw_quad.h" 12 #include "cc/quads/stream_video_draw_quad.h"
13 #include "cc/quads/texture_draw_quad.h" 13 #include "cc/quads/texture_draw_quad.h"
14 #include "cc/quads/yuv_video_draw_quad.h" 14 #include "cc/quads/yuv_video_draw_quad.h"
15 #include "cc/resources/resource_provider.h" 15 #include "cc/resources/resource_provider.h"
16 #include "cc/resources/single_release_callback.h" 16 #include "cc/resources/single_release_callback.h"
17 #include "cc/trees/layer_tree_impl.h" 17 #include "cc/trees/layer_tree_impl.h"
18 #include "cc/trees/proxy.h" 18 #include "cc/trees/proxy.h"
19 #include "media/base/video_frame.h" 19 #include "media/base/video_frame.h"
20 20
21 #if defined(GOOGLE_TV) 21 #if defined(VIDEO_HOLE)
22 #include "cc/quads/solid_color_draw_quad.h" 22 #include "cc/quads/solid_color_draw_quad.h"
23 #endif 23 #endif // defined(VIDEO_HOLE)
24 24
25 namespace cc { 25 namespace cc {
26 26
27 // static 27 // static
28 scoped_ptr<VideoLayerImpl> VideoLayerImpl::Create( 28 scoped_ptr<VideoLayerImpl> VideoLayerImpl::Create(
29 LayerTreeImpl* tree_impl, 29 LayerTreeImpl* tree_impl,
30 int id, 30 int id,
31 VideoFrameProvider* provider) { 31 VideoFrameProvider* provider) {
32 scoped_ptr<VideoLayerImpl> layer(new VideoLayerImpl(tree_impl, id)); 32 scoped_ptr<VideoLayerImpl> layer(new VideoLayerImpl(tree_impl, id));
33 layer->SetProviderClientImpl(VideoFrameProviderClientImpl::Create(provider)); 33 layer->SetProviderClientImpl(VideoFrameProviderClientImpl::Create(provider));
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 io_surface_quad->SetNew(shared_quad_state, 238 io_surface_quad->SetNew(shared_quad_state,
239 quad_rect, 239 quad_rect,
240 opaque_rect, 240 opaque_rect,
241 visible_size, 241 visible_size,
242 frame_resources_[0], 242 frame_resources_[0],
243 IOSurfaceDrawQuad::UNFLIPPED); 243 IOSurfaceDrawQuad::UNFLIPPED);
244 quad_sink->Append(io_surface_quad.PassAs<DrawQuad>(), 244 quad_sink->Append(io_surface_quad.PassAs<DrawQuad>(),
245 append_quads_data); 245 append_quads_data);
246 break; 246 break;
247 } 247 }
248 #if defined(GOOGLE_TV) 248 #if defined(VIDEO_HOLE)
249 // This block and other blocks wrapped around #if defined(GOOGLE_TV) is not 249 // This block and other blocks wrapped around #if defined(GOOGLE_TV) is not
250 // maintained by the general compositor team. Please contact the following 250 // maintained by the general compositor team. Please contact the following
251 // people instead: 251 // people instead:
252 // 252 //
253 // wonsik@chromium.org 253 // wonsik@chromium.org
254 // ycheo@chromium.org 254 // ycheo@chromium.org
255 case VideoFrameExternalResources::HOLE: { 255 case VideoFrameExternalResources::HOLE: {
256 DCHECK_EQ(frame_resources_.size(), 0u); 256 DCHECK_EQ(frame_resources_.size(), 0u);
257 scoped_ptr<SolidColorDrawQuad> solid_color_draw_quad = 257 scoped_ptr<SolidColorDrawQuad> solid_color_draw_quad =
258 SolidColorDrawQuad::Create(); 258 SolidColorDrawQuad::Create();
259 259
260 // Create a solid color quad with transparent black and force no 260 // Create a solid color quad with transparent black and force no
261 // blending / no anti-aliasing. 261 // blending / no anti-aliasing.
262 solid_color_draw_quad->SetAll( 262 solid_color_draw_quad->SetAll(
263 shared_quad_state, quad_rect, quad_rect, quad_rect, false, 263 shared_quad_state, quad_rect, quad_rect, quad_rect, false,
264 SK_ColorTRANSPARENT, true); 264 SK_ColorTRANSPARENT, true);
265 quad_sink->Append(solid_color_draw_quad.PassAs<DrawQuad>(), 265 quad_sink->Append(solid_color_draw_quad.PassAs<DrawQuad>(),
266 append_quads_data); 266 append_quads_data);
267 break; 267 break;
268 } 268 }
269 #endif 269 #endif // defined(VIDEO_HOLE)
270 case VideoFrameExternalResources::NONE: 270 case VideoFrameExternalResources::NONE:
271 NOTIMPLEMENTED(); 271 NOTIMPLEMENTED();
272 break; 272 break;
273 } 273 }
274 } 274 }
275 275
276 void VideoLayerImpl::DidDraw(ResourceProvider* resource_provider) { 276 void VideoLayerImpl::DidDraw(ResourceProvider* resource_provider) {
277 LayerImpl::DidDraw(resource_provider); 277 LayerImpl::DidDraw(resource_provider);
278 278
279 DCHECK(frame_.get()); 279 DCHECK(frame_.get());
(...skipping 29 matching lines...) Expand all
309 void VideoLayerImpl::SetProviderClientImpl( 309 void VideoLayerImpl::SetProviderClientImpl(
310 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { 310 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) {
311 provider_client_impl_ = provider_client_impl; 311 provider_client_impl_ = provider_client_impl;
312 } 312 }
313 313
314 const char* VideoLayerImpl::LayerTypeAsString() const { 314 const char* VideoLayerImpl::LayerTypeAsString() const {
315 return "cc::VideoLayerImpl"; 315 return "cc::VideoLayerImpl";
316 } 316 }
317 317
318 } // namespace cc 318 } // namespace cc
OLDNEW
« no previous file with comments | « build/common.gypi ('k') | cc/resources/video_resource_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698