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); |
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 const TextureProgram* textureProgram(); | 173 const TextureProgram* textureProgram(); |
174 const TextureProgramFlip* textureProgramFlip(); | 174 const TextureProgramFlip* textureProgramFlip(); |
175 const TextureIOSurfaceProgram* textureIOSurfaceProgram(); | 175 const TextureIOSurfaceProgram* textureIOSurfaceProgram(); |
176 | 176 |
177 const VideoYUVProgram* videoYUVProgram(); | 177 const VideoYUVProgram* videoYUVProgram(); |
178 const VideoStreamTextureProgram* videoStreamTextureProgram(); | 178 const VideoStreamTextureProgram* videoStreamTextureProgram(); |
179 | 179 |
180 const SolidColorProgram* solidColorProgram(); | 180 const SolidColorProgram* solidColorProgram(); |
181 | 181 |
| 182 bool m_hasImplThread; |
| 183 |
182 scoped_ptr<TileProgram> m_tileProgram; | 184 scoped_ptr<TileProgram> m_tileProgram; |
183 scoped_ptr<TileProgramOpaque> m_tileProgramOpaque; | 185 scoped_ptr<TileProgramOpaque> m_tileProgramOpaque; |
184 scoped_ptr<TileProgramAA> m_tileProgramAA; | 186 scoped_ptr<TileProgramAA> m_tileProgramAA; |
185 scoped_ptr<TileProgramSwizzle> m_tileProgramSwizzle; | 187 scoped_ptr<TileProgramSwizzle> m_tileProgramSwizzle; |
186 scoped_ptr<TileProgramSwizzleOpaque> m_tileProgramSwizzleOpaque; | 188 scoped_ptr<TileProgramSwizzleOpaque> m_tileProgramSwizzleOpaque; |
187 scoped_ptr<TileProgramSwizzleAA> m_tileProgramSwizzleAA; | 189 scoped_ptr<TileProgramSwizzleAA> m_tileProgramSwizzleAA; |
188 scoped_ptr<TileCheckerboardProgram> m_tileCheckerboardProgram; | 190 scoped_ptr<TileCheckerboardProgram> m_tileCheckerboardProgram; |
189 | 191 |
190 scoped_ptr<RenderPassProgram> m_renderPassProgram; | 192 scoped_ptr<RenderPassProgram> m_renderPassProgram; |
191 scoped_ptr<RenderPassProgramAA> m_renderPassProgramAA; | 193 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) | 226 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
225 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L
INE__)) | 227 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L
INE__)) |
226 #else | 228 #else |
227 #define GLC(context, x) (x) | 229 #define GLC(context, x) (x) |
228 #endif | 230 #endif |
229 | 231 |
230 | 232 |
231 } | 233 } |
232 | 234 |
233 #endif | 235 #endif |
OLD | NEW |