| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 #ifndef CC_OUTPUT_GL_RENDERER_H_ | 5 #ifndef CC_OUTPUT_GL_RENDERER_H_ |
| 6 #define CC_OUTPUT_GL_RENDERER_H_ | 6 #define CC_OUTPUT_GL_RENDERER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 // from |overlay_resource_pool_|. | 257 // from |overlay_resource_pool_|. |
| 258 // The resulting Resource may be larger than the original quad. The new size | 258 // The resulting Resource may be larger than the original quad. The new size |
| 259 // and position is placed in |new_bounds|. | 259 // and position is placed in |new_bounds|. |
| 260 void CopyRenderPassDrawQuadToOverlayResource( | 260 void CopyRenderPassDrawQuadToOverlayResource( |
| 261 const CALayerOverlay* ca_layer_overlay, | 261 const CALayerOverlay* ca_layer_overlay, |
| 262 Resource** resource, | 262 Resource** resource, |
| 263 DrawingFrame* frame, | 263 DrawingFrame* frame, |
| 264 gfx::RectF* new_bounds); | 264 gfx::RectF* new_bounds); |
| 265 | 265 |
| 266 // Schedules the |ca_layer_overlay|, which is guaranteed to have a non-null | 266 // Schedules the |ca_layer_overlay|, which is guaranteed to have a non-null |
| 267 // |rpdq| parameter. | 267 // |rpdq| parameter. Returns the resource lock for the layer contents. |
| 268 void ScheduleRenderPassDrawQuad(const CALayerOverlay* ca_layer_overlay, | 268 std::unique_ptr<ResourceProvider::ScopedReadLockGL> |
| 269 DrawingFrame* external_frame); | 269 ScheduleRenderPassDrawQuad(const CALayerOverlay* ca_layer_overlay, |
| 270 DrawingFrame* external_frame); |
| 270 | 271 |
| 271 using OverlayResourceLock = | 272 using OverlayResourceLock = |
| 272 std::unique_ptr<ResourceProvider::ScopedReadLockGL>; | 273 std::unique_ptr<ResourceProvider::ScopedReadLockGL>; |
| 273 using OverlayResourceLockList = std::vector<OverlayResourceLock>; | 274 using OverlayResourceLockList = std::vector<OverlayResourceLock>; |
| 274 | 275 |
| 276 // A resource lock for a resource that was used by ScheduleCALayer. The |
| 277 // resource can only be unlocked once its GpuMemoryBuffer is no longer in |
| 278 // use. |
| 279 struct CALayerResourceLock { |
| 280 CALayerResourceLock(); |
| 281 ~CALayerResourceLock(); |
| 282 CALayerResourceLock(CALayerResourceLock&& ca_layer_resource); |
| 283 |
| 284 uint32_t outstanding_ack_count = 0; |
| 285 std::unique_ptr<ResourceProvider::ScopedReadLockGL> lock; |
| 286 std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer; |
| 287 bool in_use_valid = false; |
| 288 }; |
| 289 std::map<unsigned, CALayerResourceLock> ca_layer_resources_; |
| 290 |
| 275 // Resources that have been sent to the GPU process, but not yet swapped. | 291 // Resources that have been sent to the GPU process, but not yet swapped. |
| 276 OverlayResourceLockList pending_overlay_resources_; | 292 OverlayResourceLockList pending_overlay_resources_; |
| 277 | 293 |
| 278 // Resources that should be shortly swapped by the GPU process. | 294 // Resources that should be shortly swapped by the GPU process. |
| 279 std::deque<OverlayResourceLockList> swapping_overlay_resources_; | 295 std::deque<OverlayResourceLockList> swapping_overlay_resources_; |
| 280 | 296 |
| 281 // Resources that the GPU process has finished swapping. The key is the | |
| 282 // texture id of the resource. | |
| 283 std::map<unsigned, OverlayResourceLock> swapped_and_acked_overlay_resources_; | |
| 284 | |
| 285 unsigned offscreen_framebuffer_id_; | 297 unsigned offscreen_framebuffer_id_; |
| 286 | 298 |
| 287 std::unique_ptr<StaticGeometryBinding> shared_geometry_; | 299 std::unique_ptr<StaticGeometryBinding> shared_geometry_; |
| 288 std::unique_ptr<DynamicGeometryBinding> clipped_geometry_; | 300 std::unique_ptr<DynamicGeometryBinding> clipped_geometry_; |
| 289 gfx::QuadF shared_geometry_quad_; | 301 gfx::QuadF shared_geometry_quad_; |
| 290 | 302 |
| 291 // This block of bindings defines all of the programs used by the compositor | 303 // This block of bindings defines all of the programs used by the compositor |
| 292 // itself. Add any new programs here to GLRendererShaderTest. | 304 // itself. Add any new programs here to GLRendererShaderTest. |
| 293 | 305 |
| 294 // Tiled layer shaders. | 306 // Tiled layer shaders. |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 bool force_drawing_frame_framebuffer_unflipped_ = false; | 553 bool force_drawing_frame_framebuffer_unflipped_ = false; |
| 542 | 554 |
| 543 BoundGeometry bound_geometry_; | 555 BoundGeometry bound_geometry_; |
| 544 ColorLUTCache color_lut_cache_; | 556 ColorLUTCache color_lut_cache_; |
| 545 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 557 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
| 546 }; | 558 }; |
| 547 | 559 |
| 548 } // namespace cc | 560 } // namespace cc |
| 549 | 561 |
| 550 #endif // CC_OUTPUT_GL_RENDERER_H_ | 562 #endif // CC_OUTPUT_GL_RENDERER_H_ |
| OLD | NEW |