Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: cc/output/gl_renderer.h

Issue 12545018: Move context-related callbacks into OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 #include "cc/output/direct_renderer.h" 9 #include "cc/output/direct_renderer.h"
10 #include "cc/output/gl_renderer_draw_cache.h" 10 #include "cc/output/gl_renderer_draw_cache.h"
(...skipping 14 matching lines...) Expand all
25 class GLRendererShaderTest; 25 class GLRendererShaderTest;
26 class OutputSurface; 26 class OutputSurface;
27 class PictureDrawQuad; 27 class PictureDrawQuad;
28 class ScopedResource; 28 class ScopedResource;
29 class StreamVideoDrawQuad; 29 class StreamVideoDrawQuad;
30 class TextureDrawQuad; 30 class TextureDrawQuad;
31 class GeometryBinding; 31 class GeometryBinding;
32 class ScopedEnsureFramebufferAllocation; 32 class ScopedEnsureFramebufferAllocation;
33 33
34 // Class that handles drawing of composited render layers using GL. 34 // Class that handles drawing of composited render layers using GL.
35 class CC_EXPORT GLRenderer 35 class CC_EXPORT GLRenderer :
36 : public DirectRenderer, 36 public DirectRenderer,
37 public NON_EXPORTED_BASE( 37 public NON_EXPORTED_BASE(
38 WebKit::WebGraphicsContext3D:: 38 WebKit::WebGraphicsContext3D::
39 WebGraphicsSwapBuffersCompleteCallbackCHROMIUM), 39 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM) {
40 public NON_EXPORTED_BASE(
41 WebKit::WebGraphicsContext3D::
42 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM),
43 public NON_EXPORTED_BASE(
44 WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback) {
45 public: 40 public:
46 static scoped_ptr<GLRenderer> Create(RendererClient* client, 41 static scoped_ptr<GLRenderer> Create(RendererClient* client,
47 OutputSurface* output_surface, 42 OutputSurface* output_surface,
48 ResourceProvider* resource_provider, 43 ResourceProvider* resource_provider,
49 int highp_threshold_min); 44 int highp_threshold_min);
50 45
51 virtual ~GLRenderer(); 46 virtual ~GLRenderer();
52 47
53 virtual const RendererCapabilities& Capabilities() const OVERRIDE; 48 virtual const RendererCapabilities& Capabilities() const OVERRIDE;
54 49
55 WebKit::WebGraphicsContext3D* Context(); 50 WebKit::WebGraphicsContext3D* Context();
56 51
57 virtual void ViewportChanged() OVERRIDE; 52 virtual void ViewportChanged() OVERRIDE;
58 53
59 virtual void ReceiveCompositorFrameAck(const CompositorFrameAck& ack)
60 OVERRIDE;
61
62 // Waits for rendering to finish. 54 // Waits for rendering to finish.
63 virtual void Finish() OVERRIDE; 55 virtual void Finish() OVERRIDE;
64 56
65 virtual void DoNoOp() OVERRIDE; 57 virtual void DoNoOp() OVERRIDE;
66 // Puts backbuffer onscreen. 58 // Puts backbuffer onscreen.
67 virtual bool SwapBuffers() OVERRIDE; 59 virtual bool SwapBuffers() OVERRIDE;
68 60
69 virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) OVERRIDE; 61 virtual void GetFramebufferPixels(void* pixels, gfx::Rect rect) OVERRIDE;
70 62
71 virtual bool IsContextLost() OVERRIDE; 63 virtual bool IsContextLost() OVERRIDE;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 bool UseScopedTexture(DrawingFrame* frame, 171 bool UseScopedTexture(DrawingFrame* frame,
180 const ScopedResource* resource, 172 const ScopedResource* resource,
181 gfx::Rect viewport_rect); 173 gfx::Rect viewport_rect);
182 174
183 bool MakeContextCurrent(); 175 bool MakeContextCurrent();
184 176
185 bool InitializeSharedObjects(); 177 bool InitializeSharedObjects();
186 void CleanupSharedObjects(); 178 void CleanupSharedObjects();
187 179
188 // WebKit:: 180 // WebKit::
189 // WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM
190 // implementation.
191 virtual void onSwapBuffersComplete() OVERRIDE;
192
193 // WebKit::
194 // WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM 181 // WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM
195 // implementation. 182 // implementation.
196 virtual void onMemoryAllocationChanged( 183 virtual void onMemoryAllocationChanged(
197 WebKit::WebGraphicsMemoryAllocation allocation) OVERRIDE; 184 WebKit::WebGraphicsMemoryAllocation allocation) OVERRIDE;
198 void DiscardBackbuffer(); 185 void DiscardBackbuffer();
199 void EnsureBackbuffer(); 186 void EnsureBackbuffer();
200 void EnforceMemoryPolicy(); 187 void EnforceMemoryPolicy();
201 188
202 // WebGraphicsContext3D::WebGraphicsContextLostCallback implementation.
203 virtual void onContextLost() OVERRIDE;
204
205 RendererCapabilities capabilities_; 189 RendererCapabilities capabilities_;
206 190
207 unsigned offscreen_framebuffer_id_; 191 unsigned offscreen_framebuffer_id_;
208 192
209 scoped_ptr<GeometryBinding> shared_geometry_; 193 scoped_ptr<GeometryBinding> shared_geometry_;
210 gfx::QuadF shared_geometry_quad_; 194 gfx::QuadF shared_geometry_quad_;
211 195
212 // This block of bindings defines all of the programs used by the compositor 196 // This block of bindings defines all of the programs used by the compositor
213 // itself. Add any new programs here to GLRendererShaderTest. 197 // itself. Add any new programs here to GLRendererShaderTest.
214 198
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 #if DEBUG_GL_CALLS && !defined(NDEBUG) 385 #if DEBUG_GL_CALLS && !defined(NDEBUG)
402 #define GLC(context, x) \ 386 #define GLC(context, x) \
403 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) 387 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__))
404 #else 388 #else
405 #define GLC(context, x) (x) 389 #define GLC(context, x) (x)
406 #endif 390 #endif
407 391
408 } // namespace cc 392 } // namespace cc
409 393
410 #endif // CC_OUTPUT_GL_RENDERER_H_ 394 #endif // CC_OUTPUT_GL_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698