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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 class StaticGeometryBinding; | 44 class StaticGeometryBinding; |
45 class DynamicGeometryBinding; | 45 class DynamicGeometryBinding; |
46 class ScopedEnsureFramebufferAllocation; | 46 class ScopedEnsureFramebufferAllocation; |
47 struct DrawRenderPassDrawQuadParams; | 47 struct DrawRenderPassDrawQuadParams; |
48 | 48 |
49 // Class that handles drawing of composited render layers using GL. | 49 // Class that handles drawing of composited render layers using GL. |
50 class CC_EXPORT GLRenderer : public DirectRenderer { | 50 class CC_EXPORT GLRenderer : public DirectRenderer { |
51 public: | 51 public: |
52 class ScopedUseGrContext; | 52 class ScopedUseGrContext; |
53 | 53 |
54 GLRenderer(RendererClient* client, | 54 GLRenderer(const RendererSettings* settings, |
55 const RendererSettings* settings, | |
56 OutputSurface* output_surface, | 55 OutputSurface* output_surface, |
57 ResourceProvider* resource_provider, | 56 ResourceProvider* resource_provider, |
58 TextureMailboxDeleter* texture_mailbox_deleter, | 57 TextureMailboxDeleter* texture_mailbox_deleter, |
59 int highp_threshold_min); | 58 int highp_threshold_min); |
60 ~GLRenderer() override; | 59 ~GLRenderer() override; |
61 | 60 |
62 const RendererCapabilitiesImpl& Capabilities() const override; | 61 const RendererCapabilitiesImpl& Capabilities() const override; |
63 | 62 |
64 void SwapBuffers(CompositorFrameMetadata metadata) override; | 63 void SwapBuffers(CompositorFrameMetadata metadata) override; |
65 void SwapBuffersComplete() override; | 64 void SwapBuffersComplete() override; |
66 | 65 |
67 void DidReceiveTextureInUseResponses( | 66 void DidReceiveTextureInUseResponses( |
68 const gpu::TextureInUseResponses& responses) override; | 67 const gpu::TextureInUseResponses& responses) override; |
69 | 68 |
70 virtual bool IsContextLost(); | 69 virtual bool IsContextLost(); |
71 | 70 |
72 protected: | 71 protected: |
73 void DidChangeVisibility() override; | 72 void DidChangeVisibility() override; |
74 | 73 |
75 bool IsBackbufferDiscarded() const { return is_backbuffer_discarded_; } | |
76 | |
77 const gfx::QuadF& SharedGeometryQuad() const { return shared_geometry_quad_; } | 74 const gfx::QuadF& SharedGeometryQuad() const { return shared_geometry_quad_; } |
78 const StaticGeometryBinding* SharedGeometry() const { | 75 const StaticGeometryBinding* SharedGeometry() const { |
79 return shared_geometry_.get(); | 76 return shared_geometry_.get(); |
80 } | 77 } |
81 | 78 |
82 void GetFramebufferPixelsAsync(const DrawingFrame* frame, | 79 void GetFramebufferPixelsAsync(const DrawingFrame* frame, |
83 const gfx::Rect& rect, | 80 const gfx::Rect& rect, |
84 std::unique_ptr<CopyOutputRequest> request); | 81 std::unique_ptr<CopyOutputRequest> request); |
85 void GetFramebufferTexture(unsigned texture_id, | 82 void GetFramebufferTexture(unsigned texture_id, |
86 const gfx::Rect& device_rect); | 83 const gfx::Rect& device_rect); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 typedef base::Callback<void(std::unique_ptr<CopyOutputRequest> copy_request, | 242 typedef base::Callback<void(std::unique_ptr<CopyOutputRequest> copy_request, |
246 bool success)> | 243 bool success)> |
247 AsyncGetFramebufferPixelsCleanupCallback; | 244 AsyncGetFramebufferPixelsCleanupCallback; |
248 void FinishedReadback(unsigned source_buffer, | 245 void FinishedReadback(unsigned source_buffer, |
249 unsigned query, | 246 unsigned query, |
250 const gfx::Size& size); | 247 const gfx::Size& size); |
251 | 248 |
252 void ReinitializeGLState(); | 249 void ReinitializeGLState(); |
253 void RestoreGLState(); | 250 void RestoreGLState(); |
254 | 251 |
255 void DiscardBackbuffer() override; | |
256 void EnsureBackbuffer() override; | |
257 | |
258 void ScheduleCALayers(DrawingFrame* frame); | 252 void ScheduleCALayers(DrawingFrame* frame); |
259 void ScheduleOverlays(DrawingFrame* frame); | 253 void ScheduleOverlays(DrawingFrame* frame); |
260 | 254 |
261 // Copies the contents of the render pass draw quad, including filter effects, | 255 // Copies the contents of the render pass draw quad, including filter effects, |
262 // to an overlay resource, returned in |resource|. The resource is allocated | 256 // to an overlay resource, returned in |resource|. The resource is allocated |
263 // from |overlay_resource_pool_|. | 257 // from |overlay_resource_pool_|. |
264 // 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 |
265 // and position is placed in |new_bounds|. | 259 // and position is placed in |new_bounds|. |
266 void CopyRenderPassDrawQuadToOverlayResource( | 260 void CopyRenderPassDrawQuadToOverlayResource( |
267 const CALayerOverlay* ca_layer_overlay, | 261 const CALayerOverlay* ca_layer_overlay, |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 SolidColorProgram solid_color_program_; | 492 SolidColorProgram solid_color_program_; |
499 SolidColorProgramAA solid_color_program_aa_; | 493 SolidColorProgramAA solid_color_program_aa_; |
500 | 494 |
501 gpu::gles2::GLES2Interface* gl_; | 495 gpu::gles2::GLES2Interface* gl_; |
502 gpu::ContextSupport* context_support_; | 496 gpu::ContextSupport* context_support_; |
503 | 497 |
504 TextureMailboxDeleter* texture_mailbox_deleter_; | 498 TextureMailboxDeleter* texture_mailbox_deleter_; |
505 | 499 |
506 gfx::Rect swap_buffer_rect_; | 500 gfx::Rect swap_buffer_rect_; |
507 gfx::Rect scissor_rect_; | 501 gfx::Rect scissor_rect_; |
508 bool is_backbuffer_discarded_; | |
509 bool is_using_bind_uniform_; | 502 bool is_using_bind_uniform_; |
510 bool is_scissor_enabled_; | 503 bool is_scissor_enabled_; |
511 bool scissor_rect_needs_reset_; | 504 bool scissor_rect_needs_reset_; |
512 bool stencil_shadow_; | 505 bool stencil_shadow_; |
513 bool blend_shadow_; | 506 bool blend_shadow_; |
514 unsigned program_shadow_; | 507 unsigned program_shadow_; |
515 TexturedQuadDrawCache draw_cache_; | 508 TexturedQuadDrawCache draw_cache_; |
516 int highp_threshold_min_; | 509 int highp_threshold_min_; |
517 int highp_threshold_cache_; | 510 int highp_threshold_cache_; |
518 | 511 |
(...skipping 29 matching lines...) Expand all Loading... |
548 bool force_drawing_frame_framebuffer_unflipped_ = false; | 541 bool force_drawing_frame_framebuffer_unflipped_ = false; |
549 | 542 |
550 BoundGeometry bound_geometry_; | 543 BoundGeometry bound_geometry_; |
551 ColorLUTCache color_lut_cache_; | 544 ColorLUTCache color_lut_cache_; |
552 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 545 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
553 }; | 546 }; |
554 | 547 |
555 } // namespace cc | 548 } // namespace cc |
556 | 549 |
557 #endif // CC_OUTPUT_GL_RENDERER_H_ | 550 #endif // CC_OUTPUT_GL_RENDERER_H_ |
OLD | NEW |