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 27 matching lines...) Expand all Loading... |
38 class ScopedResource; | 38 class ScopedResource; |
39 class StreamVideoDrawQuad; | 39 class StreamVideoDrawQuad; |
40 class TextureDrawQuad; | 40 class TextureDrawQuad; |
41 class TextureMailboxDeleter; | 41 class TextureMailboxDeleter; |
42 class GeometryBinding; | 42 class GeometryBinding; |
43 class ScopedEnsureFramebufferAllocation; | 43 class ScopedEnsureFramebufferAllocation; |
44 | 44 |
45 // Class that handles drawing of composited render layers using GL. | 45 // Class that handles drawing of composited render layers using GL. |
46 class CC_EXPORT GLRenderer : public DirectRenderer { | 46 class CC_EXPORT GLRenderer : public DirectRenderer { |
47 public: | 47 public: |
| 48 class ScopedUseGrContext; |
| 49 |
48 static scoped_ptr<GLRenderer> Create( | 50 static scoped_ptr<GLRenderer> Create( |
49 RendererClient* client, | 51 RendererClient* client, |
50 const LayerTreeSettings* settings, | 52 const LayerTreeSettings* settings, |
51 OutputSurface* output_surface, | 53 OutputSurface* output_surface, |
52 ResourceProvider* resource_provider, | 54 ResourceProvider* resource_provider, |
53 TextureMailboxDeleter* texture_mailbox_deleter, | 55 TextureMailboxDeleter* texture_mailbox_deleter, |
54 int highp_threshold_min); | 56 int highp_threshold_min); |
55 | 57 |
56 virtual ~GLRenderer(); | 58 virtual ~GLRenderer(); |
57 | 59 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 unsigned source_buffer, | 211 unsigned source_buffer, |
210 unsigned query, | 212 unsigned query, |
211 uint8_t* dest_pixels, | 213 uint8_t* dest_pixels, |
212 const gfx::Size& size); | 214 const gfx::Size& size); |
213 void PassOnSkBitmap(scoped_ptr<SkBitmap> bitmap, | 215 void PassOnSkBitmap(scoped_ptr<SkBitmap> bitmap, |
214 scoped_ptr<SkAutoLockPixels> lock, | 216 scoped_ptr<SkAutoLockPixels> lock, |
215 scoped_ptr<CopyOutputRequest> request, | 217 scoped_ptr<CopyOutputRequest> request, |
216 bool success); | 218 bool success); |
217 | 219 |
218 void ReinitializeGLState(); | 220 void ReinitializeGLState(); |
| 221 void RestoreGLState(); |
| 222 void RestoreFramebuffer(DrawingFrame* frame); |
219 | 223 |
220 virtual void DiscardBackbuffer() OVERRIDE; | 224 virtual void DiscardBackbuffer() OVERRIDE; |
221 virtual void EnsureBackbuffer() OVERRIDE; | 225 virtual void EnsureBackbuffer() OVERRIDE; |
222 void EnforceMemoryPolicy(); | 226 void EnforceMemoryPolicy(); |
223 | 227 |
224 void ScheduleOverlays(DrawingFrame* frame); | 228 void ScheduleOverlays(DrawingFrame* frame); |
225 | 229 |
226 typedef ScopedPtrVector<ResourceProvider::ScopedReadLockGL> | 230 typedef ScopedPtrVector<ResourceProvider::ScopedReadLockGL> |
227 OverlayResourceLockList; | 231 OverlayResourceLockList; |
228 OverlayResourceLockList pending_overlay_resources_; | 232 OverlayResourceLockList pending_overlay_resources_; |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 #if DEBUG_GL_CALLS && !defined(NDEBUG) | 456 #if DEBUG_GL_CALLS && !defined(NDEBUG) |
453 #define GLC(context, x) \ | 457 #define GLC(context, x) \ |
454 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) | 458 (x, GLRenderer::DebugGLCall(&* context, #x, __FILE__, __LINE__)) |
455 #else | 459 #else |
456 #define GLC(context, x) (x) | 460 #define GLC(context, x) (x) |
457 #endif | 461 #endif |
458 | 462 |
459 } // namespace cc | 463 } // namespace cc |
460 | 464 |
461 #endif // CC_OUTPUT_GL_RENDERER_H_ | 465 #endif // CC_OUTPUT_GL_RENDERER_H_ |
OLD | NEW |