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

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

Issue 13334005: Revert 191400 "cc: Add ‘chromium_code’: 1 to cc.gyp and cc_t..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « trunk/src/cc/layers/tiled_layer_unittest.cc ('k') | trunk/src/cc/output/delegating_renderer.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 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/logging.h" 7 #include "base/logging.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.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"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 return dimensions; 347 return dimensions;
348 } 348 }
349 349
350 bool VideoLayerImpl::FramePlane::AllocateData( 350 bool VideoLayerImpl::FramePlane::AllocateData(
351 ResourceProvider* resource_provider) { 351 ResourceProvider* resource_provider) {
352 if (resource_id) 352 if (resource_id)
353 return true; 353 return true;
354 354
355 resource_id = resource_provider->CreateResource( 355 resource_id = resource_provider->CreateResource(
356 size, format, ResourceProvider::TextureUsageAny); 356 size, format, ResourceProvider::TextureUsageAny);
357 return resource_id != 0; 357 return resource_id;
358 } 358 }
359 359
360 void VideoLayerImpl::FramePlane::FreeData(ResourceProvider* resource_provider) { 360 void VideoLayerImpl::FramePlane::FreeData(ResourceProvider* resource_provider) {
361 if (!resource_id) 361 if (!resource_id)
362 return; 362 return;
363 363
364 resource_provider->DeleteResource(resource_id); 364 resource_provider->DeleteResource(resource_id);
365 resource_id = 0; 365 resource_id = 0;
366 } 366 }
367 367
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 video_renderer_->Paint(frame_, 424 video_renderer_->Paint(frame_,
425 lock.sk_canvas(), 425 lock.sk_canvas(),
426 frame_->visible_rect(), 426 frame_->visible_rect(),
427 0xff); 427 0xff);
428 return true; 428 return true;
429 } 429 }
430 430
431 for (size_t plane_index = 0; plane_index < plane_count; ++plane_index) { 431 for (size_t plane_index = 0; plane_index < plane_count; ++plane_index) {
432 const VideoLayerImpl::FramePlane& plane = frame_planes_[plane_index]; 432 const VideoLayerImpl::FramePlane& plane = frame_planes_[plane_index];
433 // Only planar formats planes should need upload. 433 // Only planar formats planes should need upload.
434 DCHECK_EQ(plane.format, static_cast<unsigned>(GL_LUMINANCE)); 434 DCHECK_EQ(plane.format, GL_LUMINANCE);
435 const uint8_t* software_plane_pixels = frame_->data(plane_index); 435 const uint8_t* software_plane_pixels = frame_->data(plane_index);
436 gfx::Rect image_rect(0, 436 gfx::Rect image_rect(0,
437 0, 437 0,
438 frame_->stride(plane_index), 438 frame_->stride(plane_index),
439 plane.size.height()); 439 plane.size.height());
440 gfx::Rect source_rect(plane.size); 440 gfx::Rect source_rect(plane.size);
441 resource_provider->SetPixels(plane.resource_id, 441 resource_provider->SetPixels(plane.resource_id,
442 software_plane_pixels, 442 software_plane_pixels,
443 image_rect, 443 image_rect,
444 source_rect, 444 source_rect,
(...skipping 27 matching lines...) Expand all
472 void VideoLayerImpl::SetProviderClientImpl( 472 void VideoLayerImpl::SetProviderClientImpl(
473 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { 473 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) {
474 provider_client_impl_ = provider_client_impl; 474 provider_client_impl_ = provider_client_impl;
475 } 475 }
476 476
477 const char* VideoLayerImpl::LayerTypeAsString() const { 477 const char* VideoLayerImpl::LayerTypeAsString() const {
478 return "VideoLayer"; 478 return "VideoLayer";
479 } 479 }
480 480
481 } // namespace cc 481 } // namespace cc
OLDNEW
« no previous file with comments | « trunk/src/cc/layers/tiled_layer_unittest.cc ('k') | trunk/src/cc/output/delegating_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698