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 CCRendererGL_h | 5 #ifndef CCRendererGL_h |
| 6 #define CCRendererGL_h | 6 #define CCRendererGL_h |
| 7 | 7 |
| 8 #include "CCCheckerboardDrawQuad.h" | 8 #include "CCCheckerboardDrawQuad.h" |
| 9 #include "CCDebugBorderDrawQuad.h" | 9 #include "CCDebugBorderDrawQuad.h" |
| 10 #include "CCDirectRenderer.h" | 10 #include "CCDirectRenderer.h" |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 class TextureDrawQuad; | 26 class TextureDrawQuad; |
| 27 class GeometryBinding; | 27 class GeometryBinding; |
| 28 class ScopedEnsureFramebufferAllocation; | 28 class ScopedEnsureFramebufferAllocation; |
| 29 | 29 |
| 30 // Class that handles drawing of composited render layers using GL. | 30 // Class that handles drawing of composited render layers using GL. |
| 31 class GLRenderer : public DirectRenderer, | 31 class GLRenderer : public DirectRenderer, |
| 32 public WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffers CompleteCallbackCHROMIUM, | 32 public WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffers CompleteCallbackCHROMIUM, |
| 33 public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAlloc ationChangedCallbackCHROMIUM , | 33 public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAlloc ationChangedCallbackCHROMIUM , |
| 34 public WebKit::WebGraphicsContext3D::WebGraphicsContextLost Callback { | 34 public WebKit::WebGraphicsContext3D::WebGraphicsContextLost Callback { |
| 35 public: | 35 public: |
| 36 static scoped_ptr<GLRenderer> create(RendererClient*, ResourceProvider*); | 36 static scoped_ptr<GLRenderer> create(RendererClient*, ResourceProvider*, boo l hasImplThread); |
|
enne (OOO)
2012/10/25 17:28:24
Could you put hasImplThread in the RendererClient
| |
| 37 | 37 |
| 38 virtual ~GLRenderer(); | 38 virtual ~GLRenderer(); |
| 39 | 39 |
| 40 virtual const RendererCapabilities& capabilities() const OVERRIDE; | 40 virtual const RendererCapabilities& capabilities() const OVERRIDE; |
| 41 | 41 |
| 42 WebKit::WebGraphicsContext3D* context(); | 42 WebKit::WebGraphicsContext3D* context(); |
| 43 | 43 |
| 44 virtual void viewportChanged() OVERRIDE; | 44 virtual void viewportChanged() OVERRIDE; |
| 45 | 45 |
| 46 // waits for rendering to finish | 46 // waits for rendering to finish |
| 47 virtual void finish() OVERRIDE; | 47 virtual void finish() OVERRIDE; |
| 48 | 48 |
| 49 virtual void doNoOp() OVERRIDE; | 49 virtual void doNoOp() OVERRIDE; |
| 50 // puts backbuffer onscreen | 50 // puts backbuffer onscreen |
| 51 virtual bool swapBuffers() OVERRIDE; | 51 virtual bool swapBuffers() OVERRIDE; |
| 52 | 52 |
| 53 virtual void getFramebufferPixels(void *pixels, const IntRect&) OVERRIDE; | 53 virtual void getFramebufferPixels(void *pixels, const IntRect&) OVERRIDE; |
| 54 | 54 |
| 55 virtual bool isContextLost() OVERRIDE; | 55 virtual bool isContextLost() OVERRIDE; |
| 56 | 56 |
| 57 virtual void setVisible(bool) OVERRIDE; | 57 virtual void setVisible(bool) OVERRIDE; |
| 58 | 58 |
| 59 protected: | 59 protected: |
| 60 GLRenderer(RendererClient*, ResourceProvider*); | 60 GLRenderer(RendererClient*, ResourceProvider*, bool hasImplThread); |
| 61 | 61 |
| 62 static void debugGLCall(WebKit::WebGraphicsContext3D*, const char* command, const char* file, int line); | 62 static void debugGLCall(WebKit::WebGraphicsContext3D*, const char* command, const char* file, int line); |
| 63 | 63 |
| 64 bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; } | 64 bool isFramebufferDiscarded() const { return m_isFramebufferDiscarded; } |
| 65 bool initialize(); | 65 bool initialize(); |
| 66 | 66 |
| 67 const FloatQuad& sharedGeometryQuad() const { return m_sharedGeometryQuad; } | 67 const FloatQuad& sharedGeometryQuad() const { return m_sharedGeometryQuad; } |
| 68 const GeometryBinding* sharedGeometry() const { return m_sharedGeometry.get( ); } | 68 const GeometryBinding* sharedGeometry() const { return m_sharedGeometry.get( ); } |
| 69 | 69 |
| 70 bool getFramebufferTexture(ScopedTexture*, const IntRect& deviceRect); | 70 bool getFramebufferTexture(ScopedTexture*, const IntRect& deviceRect); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 bool makeContextCurrent(); | 106 bool makeContextCurrent(); |
| 107 | 107 |
| 108 bool initializeSharedObjects(); | 108 bool initializeSharedObjects(); |
| 109 void cleanupSharedObjects(); | 109 void cleanupSharedObjects(); |
| 110 | 110 |
| 111 // WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROM IUM implementation. | 111 // WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROM IUM implementation. |
| 112 virtual void onSwapBuffersComplete() OVERRIDE; | 112 virtual void onSwapBuffersComplete() OVERRIDE; |
| 113 | 113 |
| 114 // WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackC HROMIUM implementation. | 114 // WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackC HROMIUM implementation. |
| 115 virtual void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation) OVERRIDE; | 115 virtual void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation) OVERRIDE; |
| 116 void onMemoryAllocationChangedOnImplThread(WebKit::WebGraphicsMemoryAllocati on); | |
| 117 void discardFramebuffer(); | 116 void discardFramebuffer(); |
| 118 void ensureFramebuffer(); | 117 void ensureFramebuffer(); |
| 119 void enforceMemoryPolicy(); | 118 void enforceMemoryPolicy(); |
| 120 | 119 |
| 121 // WebGraphicsContext3D::WebGraphicsContextLostCallback implementation. | 120 // WebGraphicsContext3D::WebGraphicsContextLostCallback implementation. |
| 122 virtual void onContextLost() OVERRIDE; | 121 virtual void onContextLost() OVERRIDE; |
| 123 | 122 |
| 124 RendererCapabilities m_capabilities; | 123 RendererCapabilities m_capabilities; |
| 125 | 124 |
| 126 unsigned m_offscreenFramebufferId; | 125 unsigned m_offscreenFramebufferId; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 | 171 |
| 173 const TextureProgram* textureProgram(); | 172 const TextureProgram* textureProgram(); |
| 174 const TextureProgramFlip* textureProgramFlip(); | 173 const TextureProgramFlip* textureProgramFlip(); |
| 175 const TextureIOSurfaceProgram* textureIOSurfaceProgram(); | 174 const TextureIOSurfaceProgram* textureIOSurfaceProgram(); |
| 176 | 175 |
| 177 const VideoYUVProgram* videoYUVProgram(); | 176 const VideoYUVProgram* videoYUVProgram(); |
| 178 const VideoStreamTextureProgram* videoStreamTextureProgram(); | 177 const VideoStreamTextureProgram* videoStreamTextureProgram(); |
| 179 | 178 |
| 180 const SolidColorProgram* solidColorProgram(); | 179 const SolidColorProgram* solidColorProgram(); |
| 181 | 180 |
| 181 bool m_hasImplThread; | |
| 182 | |
| 182 scoped_ptr<TileProgram> m_tileProgram; | 183 scoped_ptr<TileProgram> m_tileProgram; |
| 183 scoped_ptr<TileProgramOpaque> m_tileProgramOpaque; | 184 scoped_ptr<TileProgramOpaque> m_tileProgramOpaque; |
| 184 scoped_ptr<TileProgramAA> m_tileProgramAA; | 185 scoped_ptr<TileProgramAA> m_tileProgramAA; |
| 185 scoped_ptr<TileProgramSwizzle> m_tileProgramSwizzle; | 186 scoped_ptr<TileProgramSwizzle> m_tileProgramSwizzle; |
| 186 scoped_ptr<TileProgramSwizzleOpaque> m_tileProgramSwizzleOpaque; | 187 scoped_ptr<TileProgramSwizzleOpaque> m_tileProgramSwizzleOpaque; |
| 187 scoped_ptr<TileProgramSwizzleAA> m_tileProgramSwizzleAA; | 188 scoped_ptr<TileProgramSwizzleAA> m_tileProgramSwizzleAA; |
| 188 scoped_ptr<TileCheckerboardProgram> m_tileCheckerboardProgram; | 189 scoped_ptr<TileCheckerboardProgram> m_tileCheckerboardProgram; |
| 189 | 190 |
| 190 scoped_ptr<RenderPassProgram> m_renderPassProgram; | 191 scoped_ptr<RenderPassProgram> m_renderPassProgram; |
| 191 scoped_ptr<RenderPassProgramAA> m_renderPassProgramAA; | 192 scoped_ptr<RenderPassProgramAA> m_renderPassProgramAA; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 225 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
| 225 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__)) | 226 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__)) |
| 226 #else | 227 #else |
| 227 #define GLC(context, x) (x) | 228 #define GLC(context, x) (x) |
| 228 #endif | 229 #endif |
| 229 | 230 |
| 230 | 231 |
| 231 } | 232 } |
| 232 | 233 |
| 233 #endif | 234 #endif |
| OLD | NEW |