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 | 5 |
6 #ifndef CCRendererGL_h | 6 #ifndef CCRendererGL_h |
7 #define CCRendererGL_h | 7 #define CCRendererGL_h |
8 | 8 |
9 #if USE(ACCELERATED_COMPOSITING) | 9 #if USE(ACCELERATED_COMPOSITING) |
10 | 10 |
| 11 #include "base/basictypes.h" |
11 #include "CCCheckerboardDrawQuad.h" | 12 #include "CCCheckerboardDrawQuad.h" |
12 #include "CCDebugBorderDrawQuad.h" | 13 #include "CCDebugBorderDrawQuad.h" |
13 #include "CCDirectRenderer.h" | 14 #include "CCDirectRenderer.h" |
14 #include "CCIOSurfaceDrawQuad.h" | 15 #include "CCIOSurfaceDrawQuad.h" |
15 #include "CCRenderPassDrawQuad.h" | 16 #include "CCRenderPassDrawQuad.h" |
16 #include "CCRenderer.h" | 17 #include "CCRenderer.h" |
17 #include "CCSolidColorDrawQuad.h" | 18 #include "CCSolidColorDrawQuad.h" |
18 #include "CCStreamVideoDrawQuad.h" | 19 #include "CCStreamVideoDrawQuad.h" |
19 #include "CCTextureDrawQuad.h" | 20 #include "CCTextureDrawQuad.h" |
20 #include "CCTileDrawQuad.h" | 21 #include "CCTileDrawQuad.h" |
21 #include "CCYUVVideoDrawQuad.h" | 22 #include "CCYUVVideoDrawQuad.h" |
22 #include "Extensions3DChromium.h" | 23 #include "Extensions3DChromium.h" |
23 #include <wtf/PassOwnPtr.h> | 24 #include <wtf/PassOwnPtr.h> |
24 | 25 |
25 namespace WebKit { | 26 namespace WebKit { |
26 class WebGraphicsContext3D; | 27 class WebGraphicsContext3D; |
27 } | 28 } |
28 | 29 |
29 namespace cc { | 30 namespace cc { |
30 | 31 |
31 class CCScopedTexture; | 32 class CCScopedTexture; |
32 class GeometryBinding; | 33 class GeometryBinding; |
33 class ScopedEnsureFramebufferAllocation; | 34 class ScopedEnsureFramebufferAllocation; |
34 | 35 |
35 // Class that handles drawing of composited render layers using GL. | 36 // Class that handles drawing of composited render layers using GL. |
36 class CCRendererGL : public CCDirectRenderer, | 37 class CCRendererGL : public CCDirectRenderer, |
37 public WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffers
CompleteCallbackCHROMIUM, | 38 public WebKit::WebGraphicsContext3D::WebGraphicsSwapBuffers
CompleteCallbackCHROMIUM, |
38 public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAlloc
ationChangedCallbackCHROMIUM , | 39 public WebKit::WebGraphicsContext3D::WebGraphicsMemoryAlloc
ationChangedCallbackCHROMIUM , |
39 public WebKit::WebGraphicsContext3D::WebGraphicsContextLost
Callback { | 40 public WebKit::WebGraphicsContext3D::WebGraphicsContextLost
Callback { |
40 WTF_MAKE_NONCOPYABLE(CCRendererGL); | |
41 public: | 41 public: |
42 static PassOwnPtr<CCRendererGL> create(CCRendererClient*, CCResourceProvider
*); | 42 static PassOwnPtr<CCRendererGL> create(CCRendererClient*, CCResourceProvider
*); |
43 | 43 |
44 virtual ~CCRendererGL(); | 44 virtual ~CCRendererGL(); |
45 | 45 |
46 virtual const RendererCapabilities& capabilities() const OVERRIDE; | 46 virtual const RendererCapabilities& capabilities() const OVERRIDE; |
47 | 47 |
48 WebKit::WebGraphicsContext3D* context(); | 48 WebKit::WebGraphicsContext3D* context(); |
49 | 49 |
50 virtual void viewportChanged() OVERRIDE; | 50 virtual void viewportChanged() OVERRIDE; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 WebKit::WebGraphicsContext3D* m_context; | 210 WebKit::WebGraphicsContext3D* m_context; |
211 | 211 |
212 IntRect m_swapBufferRect; | 212 IntRect m_swapBufferRect; |
213 bool m_isViewportChanged; | 213 bool m_isViewportChanged; |
214 bool m_isFramebufferDiscarded; | 214 bool m_isFramebufferDiscarded; |
215 bool m_isUsingBindUniform; | 215 bool m_isUsingBindUniform; |
216 bool m_visible; | 216 bool m_visible; |
217 | 217 |
218 OwnPtr<CCResourceProvider::ScopedWriteLockGL> m_currentFramebufferLock; | 218 OwnPtr<CCResourceProvider::ScopedWriteLockGL> m_currentFramebufferLock; |
| 219 |
| 220 DISALLOW_COPY_AND_ASSIGN(CCRendererGL); |
219 }; | 221 }; |
220 | 222 |
221 | 223 |
222 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL | 224 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL |
223 // call made by the compositor. Useful for debugging rendering issues but | 225 // call made by the compositor. Useful for debugging rendering issues but |
224 // will significantly degrade performance. | 226 // will significantly degrade performance. |
225 #define DEBUG_GL_CALLS 0 | 227 #define DEBUG_GL_CALLS 0 |
226 | 228 |
227 #if DEBUG_GL_CALLS && !defined ( NDEBUG ) | 229 #if DEBUG_GL_CALLS && !defined ( NDEBUG ) |
228 #define GLC(context, x) (x, CCRendererGL::debugGLCall(&*context, #x, __FILE__, _
_LINE__)) | 230 #define GLC(context, x) (x, CCRendererGL::debugGLCall(&*context, #x, __FILE__, _
_LINE__)) |
229 #else | 231 #else |
230 #define GLC(context, x) (x) | 232 #define GLC(context, x) (x) |
231 #endif | 233 #endif |
232 | 234 |
233 | 235 |
234 } | 236 } |
235 | 237 |
236 #endif // USE(ACCELERATED_COMPOSITING) | 238 #endif // USE(ACCELERATED_COMPOSITING) |
237 | 239 |
238 #endif | 240 #endif |
OLD | NEW |