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

Side by Side Diff: cc/gl_renderer.h

Issue 11293121: Add latency measurement system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor input event changes Created 8 years 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_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 18 matching lines...) Expand all
29 class ScopedResource; 29 class ScopedResource;
30 class StreamVideoDrawQuad; 30 class StreamVideoDrawQuad;
31 class TextureDrawQuad; 31 class TextureDrawQuad;
32 class GeometryBinding; 32 class GeometryBinding;
33 class ScopedEnsureFramebufferAllocation; 33 class ScopedEnsureFramebufferAllocation;
34 34
35 // Class that handles drawing of composited render layers using GL. 35 // Class that handles drawing of composited render layers using GL.
36 class CC_EXPORT GLRenderer : public DirectRenderer, 36 class CC_EXPORT GLRenderer : public DirectRenderer,
37 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM), 37 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM),
38 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM), 38 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsMemoryAllocationChangedCallbackCHROMIUM),
39 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsContextLostCallback) { 39 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsContextLostCallback),
40 public NON_EXPORTED_BASE(WebKit::WebGraphicsContext 3D::WebGraphicsLatencyInfoCallbackCHROMIUM){
jamesr 2013/01/02 23:23:39 Why do these come back through a WebGraphicsContex
40 public: 41 public:
41 static scoped_ptr<GLRenderer> create(RendererClient*, ResourceProvider*); 42 static scoped_ptr<GLRenderer> create(RendererClient*, ResourceProvider*);
42 43
43 virtual ~GLRenderer(); 44 virtual ~GLRenderer();
44 45
45 virtual const RendererCapabilities& capabilities() const OVERRIDE; 46 virtual const RendererCapabilities& capabilities() const OVERRIDE;
46 47
47 WebKit::WebGraphicsContext3D* context(); 48 WebKit::WebGraphicsContext3D* context();
48 49
49 virtual void viewportChanged() OVERRIDE; 50 virtual void viewportChanged() OVERRIDE;
50 51
51 // waits for rendering to finish 52 // waits for rendering to finish
52 virtual void finish() OVERRIDE; 53 virtual void finish() OVERRIDE;
53 54
54 virtual void doNoOp() OVERRIDE; 55 virtual void doNoOp() OVERRIDE;
55 // puts backbuffer onscreen 56 // puts backbuffer onscreen
56 virtual bool swapBuffers() OVERRIDE; 57 virtual bool swapBuffers() OVERRIDE;
57 58
58 virtual void getFramebufferPixels(void *pixels, const gfx::Rect&) OVERRIDE; 59 virtual void getFramebufferPixels(void *pixels, const gfx::Rect&) OVERRIDE;
59 60
60 virtual bool isContextLost() OVERRIDE; 61 virtual bool isContextLost() OVERRIDE;
61 62
62 virtual void setVisible(bool) OVERRIDE; 63 virtual void setVisible(bool) OVERRIDE;
63 64
65 virtual void setLatencyInfo(const WebKit::WebLatencyInfoImpl& latency_info) OVERRIDE;
66
64 virtual void sendManagedMemoryStats(size_t bytesVisible, size_t bytesVisible AndNearby, size_t bytesAllocated) OVERRIDE; 67 virtual void sendManagedMemoryStats(size_t bytesVisible, size_t bytesVisible AndNearby, size_t bytesAllocated) OVERRIDE;
65 68
66 protected: 69 protected:
67 GLRenderer(RendererClient*, ResourceProvider*); 70 GLRenderer(RendererClient*, ResourceProvider*);
68 71
69 static void debugGLCall(WebKit::WebGraphicsContext3D*, const char* command, const char* file, int line); 72 static void debugGLCall(WebKit::WebGraphicsContext3D*, const char* command, const char* file, int line);
70 73
71 bool isBackbufferDiscarded() const { return m_isBackbufferDiscarded; } 74 bool isBackbufferDiscarded() const { return m_isBackbufferDiscarded; }
72 bool initialize(); 75 bool initialize();
73 76
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 133
131 // WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackC HROMIUM implementation. 134 // WebKit::WebGraphicsContext3D::WebGraphicsMemoryAllocationChangedCallbackC HROMIUM implementation.
132 virtual void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation) OVERRIDE; 135 virtual void onMemoryAllocationChanged(WebKit::WebGraphicsMemoryAllocation) OVERRIDE;
133 void discardBackbuffer(); 136 void discardBackbuffer();
134 void ensureBackbuffer(); 137 void ensureBackbuffer();
135 void enforceMemoryPolicy(); 138 void enforceMemoryPolicy();
136 139
137 // WebGraphicsContext3D::WebGraphicsContextLostCallback implementation. 140 // WebGraphicsContext3D::WebGraphicsContextLostCallback implementation.
138 virtual void onContextLost() OVERRIDE; 141 virtual void onContextLost() OVERRIDE;
139 142
143 virtual void onReceivedLatencyInfo(const WebKit::WebLatencyInfo& latency_inf o) OVERRIDE;
144
140 RendererCapabilities m_capabilities; 145 RendererCapabilities m_capabilities;
141 146
142 unsigned m_offscreenFramebufferId; 147 unsigned m_offscreenFramebufferId;
143 148
144 scoped_ptr<GeometryBinding> m_sharedGeometry; 149 scoped_ptr<GeometryBinding> m_sharedGeometry;
145 gfx::QuadF m_sharedGeometryQuad; 150 gfx::QuadF m_sharedGeometryQuad;
146 151
147 // This block of bindings defines all of the programs used by the compositor itself. 152 // This block of bindings defines all of the programs used by the compositor itself.
148 153
149 // Tiled layer shaders. 154 // Tiled layer shaders.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 #if DEBUG_GL_CALLS && !defined(NDEBUG) 250 #if DEBUG_GL_CALLS && !defined(NDEBUG)
246 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__)) 251 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__))
247 #else 252 #else
248 #define GLC(context, x) (x) 253 #define GLC(context, x) (x)
249 #endif 254 #endif
250 255
251 256
252 } 257 }
253 258
254 #endif // CC_GL_RENDERER_H_ 259 #endif // CC_GL_RENDERER_H_
OLDNEW
« cc/DEPS ('K') | « cc/delegating_renderer.h ('k') | cc/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698