| 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_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 "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/base/scoped_ptr_deque.h" | 10 #include "cc/base/scoped_ptr_deque.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 virtual ~GLRenderer(); | 58 virtual ~GLRenderer(); |
| 59 | 59 |
| 60 virtual const RendererCapabilitiesImpl& Capabilities() const OVERRIDE; | 60 virtual const RendererCapabilitiesImpl& Capabilities() const OVERRIDE; |
| 61 | 61 |
| 62 // Waits for rendering to finish. | 62 // Waits for rendering to finish. |
| 63 virtual void Finish() OVERRIDE; | 63 virtual void Finish() OVERRIDE; |
| 64 | 64 |
| 65 virtual void DoNoOp() OVERRIDE; | 65 virtual void DoNoOp() OVERRIDE; |
| 66 virtual void SwapBuffers(const CompositorFrameMetadata& metadata) OVERRIDE; | 66 virtual void SwapBuffers(const CompositorFrameMetadata& metadata) OVERRIDE; |
| 67 | 67 |
| 68 virtual void GetFramebufferPixels(void* pixels, | |
| 69 const gfx::Rect& rect) OVERRIDE; | |
| 70 | |
| 71 virtual bool IsContextLost() OVERRIDE; | 68 virtual bool IsContextLost() OVERRIDE; |
| 72 | 69 |
| 73 virtual void SendManagedMemoryStats(size_t bytes_visible, | 70 virtual void SendManagedMemoryStats(size_t bytes_visible, |
| 74 size_t bytes_visible_and_nearby, | 71 size_t bytes_visible_and_nearby, |
| 75 size_t bytes_allocated) OVERRIDE; | 72 size_t bytes_allocated) OVERRIDE; |
| 76 | 73 |
| 77 static void DebugGLCall(gpu::gles2::GLES2Interface* gl, | 74 static void DebugGLCall(gpu::gles2::GLES2Interface* gl, |
| 78 const char* command, | 75 const char* command, |
| 79 const char* file, | 76 const char* file, |
| 80 int line); | 77 int line); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 const gfx::Rect& viewport_rect); | 192 const gfx::Rect& viewport_rect); |
| 196 | 193 |
| 197 bool MakeContextCurrent(); | 194 bool MakeContextCurrent(); |
| 198 | 195 |
| 199 void InitializeSharedObjects(); | 196 void InitializeSharedObjects(); |
| 200 void CleanupSharedObjects(); | 197 void CleanupSharedObjects(); |
| 201 | 198 |
| 202 typedef base::Callback<void(scoped_ptr<CopyOutputRequest> copy_request, | 199 typedef base::Callback<void(scoped_ptr<CopyOutputRequest> copy_request, |
| 203 bool success)> | 200 bool success)> |
| 204 AsyncGetFramebufferPixelsCleanupCallback; | 201 AsyncGetFramebufferPixelsCleanupCallback; |
| 205 void DoGetFramebufferPixels( | 202 void FinishedReadback(unsigned source_buffer, |
| 206 uint8* pixels, | 203 unsigned query, |
| 207 const gfx::Rect& window_rect, | 204 const gfx::Size& size); |
| 208 const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback); | |
| 209 void FinishedReadback( | |
| 210 const AsyncGetFramebufferPixelsCleanupCallback& cleanup_callback, | |
| 211 unsigned source_buffer, | |
| 212 unsigned query, | |
| 213 uint8_t* dest_pixels, | |
| 214 const gfx::Size& size); | |
| 215 void PassOnSkBitmap(scoped_ptr<SkBitmap> bitmap, | |
| 216 scoped_ptr<SkAutoLockPixels> lock, | |
| 217 scoped_ptr<CopyOutputRequest> request, | |
| 218 bool success); | |
| 219 | 205 |
| 220 void ReinitializeGLState(); | 206 void ReinitializeGLState(); |
| 221 void RestoreGLState(); | 207 void RestoreGLState(); |
| 222 void RestoreFramebuffer(DrawingFrame* frame); | 208 void RestoreFramebuffer(DrawingFrame* frame); |
| 223 | 209 |
| 224 virtual void DiscardBackbuffer() OVERRIDE; | 210 virtual void DiscardBackbuffer() OVERRIDE; |
| 225 virtual void EnsureBackbuffer() OVERRIDE; | 211 virtual void EnsureBackbuffer() OVERRIDE; |
| 226 void EnforceMemoryPolicy(); | 212 void EnforceMemoryPolicy(); |
| 227 | 213 |
| 228 void ScheduleOverlays(DrawingFrame* frame); | 214 void ScheduleOverlays(DrawingFrame* frame); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 441 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
| 456 #define GLC(context, x) \ | 442 #define GLC(context, x) \ |
| 457 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) | 443 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) |
| 458 #else | 444 #else |
| 459 #define GLC(context, x) (x) | 445 #define GLC(context, x) (x) |
| 460 #endif | 446 #endif |
| 461 | 447 |
| 462 } // namespace cc | 448 } // namespace cc |
| 463 | 449 |
| 464 #endif // CC_OUTPUT_GL_RENDERER_H_ | 450 #endif // CC_OUTPUT_GL_RENDERER_H_ |
| OLD | NEW |