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 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 <queue> | |
| 9 #include <vector> | |
| 10 | |
| 8 #include "cc/cc_export.h" | 11 #include "cc/cc_export.h" |
| 9 #include "cc/checkerboard_draw_quad.h" | 12 #include "cc/checkerboard_draw_quad.h" |
| 10 #include "cc/debug_border_draw_quad.h" | 13 #include "cc/debug_border_draw_quad.h" |
| 11 #include "cc/direct_renderer.h" | 14 #include "cc/direct_renderer.h" |
| 12 #include "cc/gl_renderer_draw_cache.h" | 15 #include "cc/gl_renderer_draw_cache.h" |
| 13 #include "cc/io_surface_draw_quad.h" | 16 #include "cc/io_surface_draw_quad.h" |
| 14 #include "cc/output_surface.h" | 17 #include "cc/output_surface.h" |
| 15 #include "cc/render_pass_draw_quad.h" | 18 #include "cc/render_pass_draw_quad.h" |
| 16 #include "cc/renderer.h" | 19 #include "cc/renderer.h" |
| 17 #include "cc/solid_color_draw_quad.h" | 20 #include "cc/solid_color_draw_quad.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 38 static scoped_ptr<GLRenderer> create(RendererClient*, OutputSurface*, Resour ceProvider*); | 41 static scoped_ptr<GLRenderer> create(RendererClient*, OutputSurface*, Resour ceProvider*); |
| 39 | 42 |
| 40 virtual ~GLRenderer(); | 43 virtual ~GLRenderer(); |
| 41 | 44 |
| 42 virtual const RendererCapabilities& capabilities() const OVERRIDE; | 45 virtual const RendererCapabilities& capabilities() const OVERRIDE; |
| 43 | 46 |
| 44 WebKit::WebGraphicsContext3D* context(); | 47 WebKit::WebGraphicsContext3D* context(); |
| 45 | 48 |
| 46 virtual void viewportChanged() OVERRIDE; | 49 virtual void viewportChanged() OVERRIDE; |
| 47 | 50 |
| 51 virtual void receiveCompositorFrameAck(const CompositorFrameAck&) OVERRIDE; | |
| 52 | |
| 48 // waits for rendering to finish | 53 // waits for rendering to finish |
| 49 virtual void finish() OVERRIDE; | 54 virtual void finish() OVERRIDE; |
| 50 | 55 |
| 51 virtual void doNoOp() OVERRIDE; | 56 virtual void doNoOp() OVERRIDE; |
| 52 // puts backbuffer onscreen | 57 // puts backbuffer onscreen |
| 53 virtual bool swapBuffers() OVERRIDE; | 58 virtual bool swapBuffers() OVERRIDE; |
| 54 | 59 |
| 55 virtual void getFramebufferPixels(void *pixels, const gfx::Rect&) OVERRIDE; | 60 virtual void getFramebufferPixels(void *pixels, const gfx::Rect&) OVERRIDE; |
| 56 | 61 |
| 57 virtual bool isContextLost() OVERRIDE; | 62 virtual bool isContextLost() OVERRIDE; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 | 224 |
| 220 gfx::Rect m_swapBufferRect; | 225 gfx::Rect m_swapBufferRect; |
| 221 gfx::Rect m_scissorRect; | 226 gfx::Rect m_scissorRect; |
| 222 bool m_isViewportChanged; | 227 bool m_isViewportChanged; |
| 223 bool m_isBackbufferDiscarded; | 228 bool m_isBackbufferDiscarded; |
| 224 bool m_discardBackbufferWhenNotVisible; | 229 bool m_discardBackbufferWhenNotVisible; |
| 225 bool m_isUsingBindUniform; | 230 bool m_isUsingBindUniform; |
| 226 bool m_visible; | 231 bool m_visible; |
| 227 bool m_isScissorEnabled; | 232 bool m_isScissorEnabled; |
| 228 bool m_blendShadow; | 233 bool m_blendShadow; |
| 234 bool m_renderToMailbox; | |
| 229 unsigned m_programShadow; | 235 unsigned m_programShadow; |
| 230 TexturedQuadDrawCache m_drawCache; | 236 TexturedQuadDrawCache m_drawCache; |
| 231 | 237 |
| 238 struct MailboxTexture | |
|
danakj
2013/01/18 01:01:41
considering that we're going to have a TextureMail
no sievers
2013/02/06 23:36:00
Done.
| |
| 239 { | |
| 240 MailboxTexture() | |
| 241 : textureId(0) {} | |
| 242 | |
| 243 MailboxTexture(uint32 textureId, | |
| 244 const Mailbox& mailbox, | |
| 245 const gfx::Size& size) | |
| 246 : textureId(textureId), | |
| 247 mailbox(mailbox), | |
| 248 size(size) {} | |
| 249 | |
| 250 uint32 textureId; | |
| 251 Mailbox mailbox; | |
| 252 gfx::Size size; | |
| 253 }; | |
| 254 MailboxTexture m_currentBacking; | |
| 255 std::vector<MailboxTexture> m_pendingFrames; | |
| 256 std::queue<MailboxTexture> m_returnedTextures; | |
| 257 | |
| 232 scoped_ptr<ResourceProvider::ScopedWriteLockGL> m_currentFramebufferLock; | 258 scoped_ptr<ResourceProvider::ScopedWriteLockGL> m_currentFramebufferLock; |
| 233 | 259 |
| 234 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 260 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
| 235 }; | 261 }; |
| 236 | 262 |
| 237 | 263 |
| 238 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL | 264 // Setting DEBUG_GL_CALLS to 1 will call glGetError() after almost every GL |
| 239 // call made by the compositor. Useful for debugging rendering issues but | 265 // call made by the compositor. Useful for debugging rendering issues but |
| 240 // will significantly degrade performance. | 266 // will significantly degrade performance. |
| 241 #define DEBUG_GL_CALLS 0 | 267 #define DEBUG_GL_CALLS 0 |
| 242 | 268 |
| 243 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 269 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
| 244 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__)) | 270 #define GLC(context, x) (x, GLRenderer::debugGLCall(&*context, #x, __FILE__, __L INE__)) |
| 245 #else | 271 #else |
| 246 #define GLC(context, x) (x) | 272 #define GLC(context, x) (x) |
| 247 #endif | 273 #endif |
| 248 | 274 |
| 249 | 275 |
| 250 } | 276 } |
| 251 | 277 |
| 252 #endif // CC_GL_RENDERER_H_ | 278 #endif // CC_GL_RENDERER_H_ |
| OLD | NEW |