| 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 "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/base/scoped_ptr_deque.h" | 10 #include "cc/base/scoped_ptr_deque.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class GeometryBinding; | 42 class GeometryBinding; |
| 43 class ScopedEnsureFramebufferAllocation; | 43 class ScopedEnsureFramebufferAllocation; |
| 44 | 44 |
| 45 // Class that handles drawing of composited render layers using GL. | 45 // Class that handles drawing of composited render layers using GL. |
| 46 class CC_EXPORT GLRenderer : public DirectRenderer { | 46 class CC_EXPORT GLRenderer : public DirectRenderer { |
| 47 public: | 47 public: |
| 48 class ScopedUseGrContext; | 48 class ScopedUseGrContext; |
| 49 | 49 |
| 50 static scoped_ptr<GLRenderer> Create( | 50 static scoped_ptr<GLRenderer> Create( |
| 51 RendererClient* client, | 51 RendererClient* client, |
| 52 const LayerTreeSettings* settings, | 52 const RendererSettings* settings, |
| 53 OutputSurface* output_surface, | 53 OutputSurface* output_surface, |
| 54 ResourceProvider* resource_provider, | 54 ResourceProvider* resource_provider, |
| 55 TextureMailboxDeleter* texture_mailbox_deleter, | 55 TextureMailboxDeleter* texture_mailbox_deleter, |
| 56 int highp_threshold_min); | 56 int highp_threshold_min); |
| 57 | 57 |
| 58 ~GLRenderer() override; | 58 ~GLRenderer() override; |
| 59 | 59 |
| 60 const RendererCapabilitiesImpl& Capabilities() const override; | 60 const RendererCapabilitiesImpl& Capabilities() const override; |
| 61 | 61 |
| 62 // Waits for rendering to finish. | 62 // Waits for rendering to finish. |
| 63 void Finish() override; | 63 void Finish() override; |
| 64 | 64 |
| 65 void DoNoOp() override; | 65 void DoNoOp() override; |
| 66 void SwapBuffers(const CompositorFrameMetadata& metadata) override; | 66 void SwapBuffers(const CompositorFrameMetadata& metadata) override; |
| 67 | 67 |
| 68 virtual bool IsContextLost(); | 68 virtual bool IsContextLost(); |
| 69 | 69 |
| 70 static void DebugGLCall(gpu::gles2::GLES2Interface* gl, | 70 static void DebugGLCall(gpu::gles2::GLES2Interface* gl, |
| 71 const char* command, | 71 const char* command, |
| 72 const char* file, | 72 const char* file, |
| 73 int line); | 73 int line); |
| 74 | 74 |
| 75 protected: | 75 protected: |
| 76 GLRenderer(RendererClient* client, | 76 GLRenderer(RendererClient* client, |
| 77 const LayerTreeSettings* settings, | 77 const RendererSettings* settings, |
| 78 OutputSurface* output_surface, | 78 OutputSurface* output_surface, |
| 79 ResourceProvider* resource_provider, | 79 ResourceProvider* resource_provider, |
| 80 TextureMailboxDeleter* texture_mailbox_deleter, | 80 TextureMailboxDeleter* texture_mailbox_deleter, |
| 81 int highp_threshold_min); | 81 int highp_threshold_min); |
| 82 | 82 |
| 83 void DidChangeVisibility() override; | 83 void DidChangeVisibility() override; |
| 84 | 84 |
| 85 bool IsBackbufferDiscarded() const { return is_backbuffer_discarded_; } | 85 bool IsBackbufferDiscarded() const { return is_backbuffer_discarded_; } |
| 86 | 86 |
| 87 const gfx::QuadF& SharedGeometryQuad() const { return shared_geometry_quad_; } | 87 const gfx::QuadF& SharedGeometryQuad() const { return shared_geometry_quad_; } |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 468 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
| 469 #define GLC(context, x) \ | 469 #define GLC(context, x) \ |
| 470 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) | 470 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) |
| 471 #else | 471 #else |
| 472 #define GLC(context, x) (x) | 472 #define GLC(context, x) (x) |
| 473 #endif | 473 #endif |
| 474 | 474 |
| 475 } // namespace cc | 475 } // namespace cc |
| 476 | 476 |
| 477 #endif // CC_OUTPUT_GL_RENDERER_H_ | 477 #endif // CC_OUTPUT_GL_RENDERER_H_ |
| OLD | NEW |