Skip to content

Commit

Permalink
Fixed case with no GLImage.
Browse files Browse the repository at this point in the history
Regression occured in https://codereview.chromium.org/2006923006.
Because of incorrect merge with
https://codereview.chromium.org/2113443003.

BUG=625521
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel;tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2117103002
Cr-Commit-Position: refs/heads/master@{#403748}
  • Loading branch information
kirr authored and Commit bot committed Jul 5, 2016
1 parent 7e1e6ff commit db4c492
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
12 changes: 7 additions & 5 deletions gpu/ipc/service/image_transport_surface_overlay_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,13 @@ void IOSurfaceContextNoOp(scoped_refptr<ui::IOSurfaceContext>) {

bool ImageTransportSurfaceOverlayMac::ScheduleCALayer(
const ui::CARendererLayerParams& params) {
gl::GLImageIOSurface* io_surface_image =
gl::GLImageIOSurface::FromGLImage(params.image);
if (!io_surface_image) {
DLOG(ERROR) << "Cannot schedule CALayer with non-IOSurface GLImage";
return false;
if (params.image) {
gl::GLImageIOSurface* io_surface_image =
gl::GLImageIOSurface::FromGLImage(params.image);
if (!io_surface_image) {
DLOG(ERROR) << "Cannot schedule CALayer with non-IOSurface GLImage";
return false;
}
}
return ca_layer_tree_coordinator_->GetPendingCARendererLayerTree()
->ScheduleCALayer(params);
Expand Down
16 changes: 9 additions & 7 deletions ui/accelerated_widget_mac/ca_renderer_layer_tree.mm
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,15 @@ bool AVSampleBufferDisplayLayerEnqueueIOSurface(

void CARendererLayerTree::TransformLayer::AddContentLayer(
const CARendererLayerParams& params) {
gl::GLImageIOSurface* io_surface_image =
gl::GLImageIOSurface::FromGLImage(params.image);
DCHECK(io_surface_image);
base::ScopedCFTypeRef<IOSurfaceRef> io_surface =
io_surface_image->io_surface();
base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer =
io_surface_image->cv_pixel_buffer();
base::ScopedCFTypeRef<IOSurfaceRef> io_surface;
base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer;
if (params.image) {
gl::GLImageIOSurface* io_surface_image =
gl::GLImageIOSurface::FromGLImage(params.image);
DCHECK(io_surface_image);
io_surface = io_surface_image->io_surface();
cv_pixel_buffer = io_surface_image->cv_pixel_buffer();
}

content_layers.push_back(
ContentLayer(io_surface, cv_pixel_buffer, params.contents_rect,
Expand Down

0 comments on commit db4c492

Please sign in to comment.