| OLD | NEW |
| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 bool ImageTransportSurfaceOverlayMac::ScheduleCALayer( | 291 bool ImageTransportSurfaceOverlayMac::ScheduleCALayer( |
| 292 gl::GLImage* contents_image, | 292 gl::GLImage* contents_image, |
| 293 const gfx::RectF& contents_rect, | 293 const gfx::RectF& contents_rect, |
| 294 float opacity, | 294 float opacity, |
| 295 unsigned background_color, | 295 unsigned background_color, |
| 296 unsigned edge_aa_mask, | 296 unsigned edge_aa_mask, |
| 297 const gfx::RectF& rect, | 297 const gfx::RectF& rect, |
| 298 bool is_clipped, | 298 bool is_clipped, |
| 299 const gfx::RectF& clip_rect, | 299 const gfx::RectF& clip_rect, |
| 300 const gfx::Transform& transform, | 300 const gfx::Transform& transform, |
| 301 int sorting_context_id) { | 301 int sorting_context_id, |
| 302 unsigned filter) { |
| 302 base::ScopedCFTypeRef<IOSurfaceRef> io_surface; | 303 base::ScopedCFTypeRef<IOSurfaceRef> io_surface; |
| 303 if (contents_image) { | 304 if (contents_image) { |
| 304 io_surface = | 305 io_surface = |
| 305 static_cast<gl::GLImageIOSurface*>(contents_image)->io_surface(); | 306 static_cast<gl::GLImageIOSurface*>(contents_image)->io_surface(); |
| 306 } | 307 } |
| 307 if (!pending_ca_layer_tree_) | 308 if (!pending_ca_layer_tree_) |
| 308 pending_ca_layer_tree_.reset(new CALayerTree); | 309 pending_ca_layer_tree_.reset(new CALayerTree); |
| 309 return pending_ca_layer_tree_->ScheduleCALayer( | 310 return pending_ca_layer_tree_->ScheduleCALayer( |
| 310 is_clipped, gfx::ToEnclosingRect(clip_rect), sorting_context_id, | 311 is_clipped, gfx::ToEnclosingRect(clip_rect), sorting_context_id, |
| 311 transform, io_surface, contents_rect, gfx::ToEnclosingRect(rect), | 312 transform, io_surface, contents_rect, gfx::ToEnclosingRect(rect), |
| (...skipping 29 matching lines...) Expand all Loading... |
| 341 gl_renderer_id_ = context_renderer_id & kCGLRendererIDMatchingMask; | 342 gl_renderer_id_ = context_renderer_id & kCGLRendererIDMatchingMask; |
| 342 | 343 |
| 343 // Post a task holding a reference to the new GL context. The reason for | 344 // Post a task holding a reference to the new GL context. The reason for |
| 344 // this is to avoid creating-then-destroying the context for every image | 345 // this is to avoid creating-then-destroying the context for every image |
| 345 // transport surface that is observing the GPU switch. | 346 // transport surface that is observing the GPU switch. |
| 346 base::MessageLoop::current()->PostTask( | 347 base::MessageLoop::current()->PostTask( |
| 347 FROM_HERE, base::Bind(&IOSurfaceContextNoOp, context_on_new_gpu)); | 348 FROM_HERE, base::Bind(&IOSurfaceContextNoOp, context_on_new_gpu)); |
| 348 } | 349 } |
| 349 | 350 |
| 350 } // namespace gpu | 351 } // namespace gpu |
| OLD | NEW |