Chromium Code Reviews| 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_GL_RENDERER_H_ | 5 #ifndef CC_GL_RENDERER_H_ |
| 6 #define CC_GL_RENDERER_H_ | 6 #define CC_GL_RENDERER_H_ |
| 7 | 7 |
| 8 #include "cc/cc_export.h" | 8 #include "cc/cc_export.h" |
| 9 #include "cc/checkerboard_draw_quad.h" | 9 #include "cc/checkerboard_draw_quad.h" |
| 10 #include "cc/debug_border_draw_quad.h" | 10 #include "cc/debug_border_draw_quad.h" |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 // Class that handles drawing of composited render layers using GL. | 33 // Class that handles drawing of composited render layers using GL. |
| 34 class CC_EXPORT GLRenderer : public DirectRenderer, | 34 class CC_EXPORT GLRenderer : public DirectRenderer, |
| 35 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM), | 35 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM), |
| 36 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM), | 36 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM), |
| 37 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsContextLostCallback) { | 37 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsContextLostCallback) { |
| 38 public: | 38 public: |
| 39 static scoped_ptr<GLRenderer> create(RendererClient*, ResourceProvider*); | 39 static scoped_ptr<GLRenderer> create(RendererClient*, ResourceProvider*); |
| 40 | 40 |
| 41 virtual ~GLRenderer(); | 41 virtual ~GLRenderer(); |
| 42 | 42 |
| 43 bool initialize(); | |
|
danakj
2012/12/01 01:56:36
I don't see why you need this?
| |
| 44 | |
| 43 virtual const RendererCapabilities& capabilities() const OVERRIDE; | 45 virtual const RendererCapabilities& capabilities() const OVERRIDE; |
| 44 | 46 |
| 45 WebKit::WebGraphicsContext3D* context(); | 47 WebKit::WebGraphicsContext3D* context(); |
| 46 | 48 |
| 47 virtual void viewportChanged() OVERRIDE; | 49 virtual void viewportChanged() OVERRIDE; |
| 48 | 50 |
| 49 // waits for rendering to finish | 51 // waits for rendering to finish |
| 50 virtual void finish() OVERRIDE; | 52 virtual void finish() OVERRIDE; |
| 51 | 53 |
| 52 virtual void doNoOp() OVERRIDE; | 54 virtual void doNoOp() OVERRIDE; |
| 53 // puts backbuffer onscreen | 55 // puts backbuffer onscreen |
| 54 virtual bool swapBuffers() OVERRIDE; | 56 virtual bool swapBuffers() OVERRIDE; |
| 55 | 57 |
| 56 virtual void getFramebufferPixels(void *pixels, const gfx::Rect&) OVERRIDE; | 58 virtual void getFramebufferPixels(void *pixels, const gfx::Rect&) OVERRIDE; |
| 57 | 59 |
| 58 virtual bool isContextLost() OVERRIDE; | 60 virtual bool isContextLost() OVERRIDE; |
| 59 | 61 |
| 60 virtual void setVisible(bool) OVERRIDE; | 62 virtual void setVisible(bool) OVERRIDE; |
| 61 | 63 |
| 62 virtual void sendManagedMemoryStats(size_t bytesVisible, size_t bytesVisible AndNearby, size_t bytesAllocated) OVERRIDE; | 64 virtual void sendManagedMemoryStats(size_t bytesVisible, size_t bytesVisible AndNearby, size_t bytesAllocated) OVERRIDE; |
| 63 | 65 |
| 64 protected: | 66 protected: |
| 65 GLRenderer(RendererClient*, ResourceProvider*); | 67 GLRenderer(RendererClient*, ResourceProvider*); |
| 66 | 68 |
| 67 static void debugGLCall(WebKit::WebGraphicsContext3D*, const char* command, const char* file, int line); | 69 static void debugGLCall(WebKit::WebGraphicsContext3D*, const char* command, const char* file, int line); |
| 68 | 70 |
| 69 bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; } | 71 bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; } |
| 70 bool initialize(); | |
| 71 | 72 |
| 72 const gfx::QuadF& sharedGeometryQuad() const { return m_sharedGeometryQuad; } | 73 const gfx::QuadF& sharedGeometryQuad() const { return m_sharedGeometryQuad; } |
| 73 const GeometryBinding* sharedGeometry() const { return m_sharedGeometry.get( ); } | 74 const GeometryBinding* sharedGeometry() const { return m_sharedGeometry.get( ); } |
| 74 | 75 |
| 75 bool getFramebufferTexture(ScopedResource*, const gfx::Rect& deviceRect); | 76 bool getFramebufferTexture(ScopedResource*, const gfx::Rect& deviceRect); |
| 76 void releaseRenderPassTextures(); | 77 void releaseRenderPassTextures(); |
| 77 | 78 |
| 78 virtual void bindFramebufferToOutputSurface(DrawingFrame&) OVERRIDE; | 79 virtual void bindFramebufferToOutputSurface(DrawingFrame&) OVERRIDE; |
| 79 virtual bool bindFramebufferToTexture(DrawingFrame&, const ScopedResource*, const gfx::Rect& framebufferRect) OVERRIDE; | 80 virtual bool bindFramebufferToTexture(DrawingFrame&, const ScopedResource*, const gfx::Rect& framebufferRect) OVERRIDE; |
| 80 virtual void setDrawViewportSize(const gfx::Size&) OVERRIDE; | 81 virtual void setDrawViewportSize(const gfx::Size&) OVERRIDE; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 243 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 244 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
| 244 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__)) | 245 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__)) |
| 245 #else | 246 #else |
| 246 #define GLC(context, x) (x) | 247 #define GLC(context, x) (x) |
| 247 #endif | 248 #endif |
| 248 | 249 |
| 249 | 250 |
| 250 } | 251 } |
| 251 | 252 |
| 252 #endif // CC_GL_RENDERER_H_ | 253 #endif // CC_GL_RENDERER_H_ |
| OLD | NEW |