| 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 <set> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/cancelable_callback.h" | 12 #include "base/cancelable_callback.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 14 #include "cc/output/color_lut_cache.h" | 15 #include "cc/output/color_lut_cache.h" |
| 15 #include "cc/output/context_cache_controller.h" | 16 #include "cc/output/context_cache_controller.h" |
| 16 #include "cc/output/direct_renderer.h" | 17 #include "cc/output/direct_renderer.h" |
| 17 #include "cc/output/gl_renderer_draw_cache.h" | 18 #include "cc/output/gl_renderer_draw_cache.h" |
| 18 #include "cc/output/program_binding.h" | 19 #include "cc/output/program_binding.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 const CALayerOverlay* ca_layer_overlay, | 264 const CALayerOverlay* ca_layer_overlay, |
| 264 Resource** resource, | 265 Resource** resource, |
| 265 DrawingFrame* frame, | 266 DrawingFrame* frame, |
| 266 gfx::RectF* new_bounds); | 267 gfx::RectF* new_bounds); |
| 267 | 268 |
| 268 // Schedules the |ca_layer_overlay|, which is guaranteed to have a non-null | 269 // Schedules the |ca_layer_overlay|, which is guaranteed to have a non-null |
| 269 // |rpdq| parameter. | 270 // |rpdq| parameter. |
| 270 void ScheduleRenderPassDrawQuad(const CALayerOverlay* ca_layer_overlay, | 271 void ScheduleRenderPassDrawQuad(const CALayerOverlay* ca_layer_overlay, |
| 271 DrawingFrame* external_frame); | 272 DrawingFrame* external_frame); |
| 272 | 273 |
| 274 // Setup/flush all pending overdraw feedback to framebuffer. |
| 275 void SetupOverdrawFeedback(); |
| 276 void FlushOverdrawFeedback(const DrawingFrame* frame, |
| 277 const gfx::Rect& output_rect); |
| 278 // Process overdraw feedback from query. |
| 279 using OverdrawResult = std::set<int>; |
| 280 void ProcessOverdrawFeedback(unsigned query, |
| 281 int category, |
| 282 OverdrawResult* overdraw, |
| 283 const base::Closure& callback); |
| 284 static void UpdateOverdrawCounter(const OverdrawResult* overdraw); |
| 285 |
| 273 using OverlayResourceLock = | 286 using OverlayResourceLock = |
| 274 std::unique_ptr<ResourceProvider::ScopedReadLockGL>; | 287 std::unique_ptr<ResourceProvider::ScopedReadLockGL>; |
| 275 using OverlayResourceLockList = std::vector<OverlayResourceLock>; | 288 using OverlayResourceLockList = std::vector<OverlayResourceLock>; |
| 276 | 289 |
| 277 // Resources that have been sent to the GPU process, but not yet swapped. | 290 // Resources that have been sent to the GPU process, but not yet swapped. |
| 278 OverlayResourceLockList pending_overlay_resources_; | 291 OverlayResourceLockList pending_overlay_resources_; |
| 279 | 292 |
| 280 // Resources that should be shortly swapped by the GPU process. | 293 // Resources that should be shortly swapped by the GPU process. |
| 281 std::deque<OverlayResourceLockList> swapping_overlay_resources_; | 294 std::deque<OverlayResourceLockList> swapping_overlay_resources_; |
| 282 | 295 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 // The method FlippedFramebuffer determines whether the framebuffer associated | 369 // The method FlippedFramebuffer determines whether the framebuffer associated |
| 357 // with a DrawingFrame is flipped. It makes the assumption that the | 370 // with a DrawingFrame is flipped. It makes the assumption that the |
| 358 // DrawingFrame is being used as part of a render pass. If a DrawingFrame is | 371 // DrawingFrame is being used as part of a render pass. If a DrawingFrame is |
| 359 // not being used as part of a render pass, setting it here forces | 372 // not being used as part of a render pass, setting it here forces |
| 360 // FlippedFramebuffer to return |true|. | 373 // FlippedFramebuffer to return |true|. |
| 361 bool force_drawing_frame_framebuffer_unflipped_ = false; | 374 bool force_drawing_frame_framebuffer_unflipped_ = false; |
| 362 | 375 |
| 363 BoundGeometry bound_geometry_; | 376 BoundGeometry bound_geometry_; |
| 364 ColorLUTCache color_lut_cache_; | 377 ColorLUTCache color_lut_cache_; |
| 365 | 378 |
| 379 unsigned offscreen_stencil_renderbuffer_id_ = 0; |
| 380 gfx::Size offscreen_stencil_renderbuffer_size_; |
| 381 |
| 366 base::WeakPtrFactory<GLRenderer> weak_ptr_factory_; | 382 base::WeakPtrFactory<GLRenderer> weak_ptr_factory_; |
| 367 | 383 |
| 368 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 384 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
| 369 }; | 385 }; |
| 370 | 386 |
| 371 } // namespace cc | 387 } // namespace cc |
| 372 | 388 |
| 373 #endif // CC_OUTPUT_GL_RENDERER_H_ | 389 #endif // CC_OUTPUT_GL_RENDERER_H_ |
| OLD | NEW |