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

Side by Side Diff: gpu/ipc/service/image_transport_surface_overlay_mac.mm

Issue 2117103002: Fixed case with no GLImage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | ui/accelerated_widget_mac/ca_renderer_layer_tree.mm » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "gpu/ipc/service/image_transport_surface_overlay_mac.h" 5 #include "gpu/ipc/service/image_transport_surface_overlay_mac.h"
6 6
7 #include <CoreGraphics/CoreGraphics.h> 7 #include <CoreGraphics/CoreGraphics.h>
8 #include <IOSurface/IOSurface.h> 8 #include <IOSurface/IOSurface.h>
9 #include <OpenGL/CGLRenderers.h> 9 #include <OpenGL/CGLRenderers.h>
10 #include <OpenGL/CGLTypes.h> 10 #include <OpenGL/CGLTypes.h>
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 if (!io_surface_image) { 325 if (!io_surface_image) {
326 DLOG(ERROR) << "Not an IOSurface image."; 326 DLOG(ERROR) << "Not an IOSurface image.";
327 return false; 327 return false;
328 } 328 }
329 return ca_layer_tree_coordinator_->SetPendingGLRendererBackbuffer( 329 return ca_layer_tree_coordinator_->SetPendingGLRendererBackbuffer(
330 io_surface_image->io_surface()); 330 io_surface_image->io_surface());
331 } 331 }
332 332
333 bool ImageTransportSurfaceOverlayMac::ScheduleCALayer( 333 bool ImageTransportSurfaceOverlayMac::ScheduleCALayer(
334 const ui::CARendererLayerParams& params) { 334 const ui::CARendererLayerParams& params) {
335 gl::GLImageIOSurface* io_surface_image = 335 if (params.image) {
336 gl::GLImageIOSurface::FromGLImage(params.image); 336 gl::GLImageIOSurface* io_surface_image =
337 if (!io_surface_image) { 337 gl::GLImageIOSurface::FromGLImage(params.image);
338 DLOG(ERROR) << "Cannot schedule CALayer with non-IOSurface GLImage"; 338 if (!io_surface_image) {
339 return false; 339 DLOG(ERROR) << "Cannot schedule CALayer with non-IOSurface GLImage";
340 return false;
341 }
340 } 342 }
341 return ca_layer_tree_coordinator_->GetPendingCARendererLayerTree() 343 return ca_layer_tree_coordinator_->GetPendingCARendererLayerTree()
342 ->ScheduleCALayer(params); 344 ->ScheduleCALayer(params);
343 } 345 }
344 346
345 void ImageTransportSurfaceOverlayMac::ScheduleCALayerInUseQuery( 347 void ImageTransportSurfaceOverlayMac::ScheduleCALayerInUseQuery(
346 std::vector<CALayerInUseQuery> queries) { 348 std::vector<CALayerInUseQuery> queries) {
347 ca_layer_in_use_queries_.swap(queries); 349 ca_layer_in_use_queries_.swap(queries);
348 } 350 }
349 351
(...skipping 26 matching lines...) Expand all
376 gl_renderer_id_ = context_renderer_id & kCGLRendererIDMatchingMask; 378 gl_renderer_id_ = context_renderer_id & kCGLRendererIDMatchingMask;
377 379
378 // Post a task holding a reference to the new GL context. The reason for 380 // Post a task holding a reference to the new GL context. The reason for
379 // this is to avoid creating-then-destroying the context for every image 381 // this is to avoid creating-then-destroying the context for every image
380 // transport surface that is observing the GPU switch. 382 // transport surface that is observing the GPU switch.
381 base::MessageLoop::current()->PostTask( 383 base::MessageLoop::current()->PostTask(
382 FROM_HERE, base::Bind(&IOSurfaceContextNoOp, context_on_new_gpu)); 384 FROM_HERE, base::Bind(&IOSurfaceContextNoOp, context_on_new_gpu));
383 } 385 }
384 386
385 } // namespace gpu 387 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | ui/accelerated_widget_mac/ca_renderer_layer_tree.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698