OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 APP_SURFACE_ACCELERATED_SURFACE_MAC_H_ | 5 #ifndef APP_SURFACE_ACCELERATED_SURFACE_MAC_H_ |
6 #define APP_SURFACE_ACCELERATED_SURFACE_MAC_H_ | 6 #define APP_SURFACE_ACCELERATED_SURFACE_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <CoreFoundation/CoreFoundation.h> | 9 #include <CoreFoundation/CoreFoundation.h> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 // Encapsulates an accelerated GL surface that can be shared across processes | 29 // Encapsulates an accelerated GL surface that can be shared across processes |
30 // on systems that support it (10.6 and above). For systems that do not, it | 30 // on systems that support it (10.6 and above). For systems that do not, it |
31 // uses a regular dib. There will either be an IOSurface or a TransportDIB, | 31 // uses a regular dib. There will either be an IOSurface or a TransportDIB, |
32 // never both. | 32 // never both. |
33 | 33 |
34 class AcceleratedSurface { | 34 class AcceleratedSurface { |
35 public: | 35 public: |
36 AcceleratedSurface(); | 36 AcceleratedSurface(); |
37 virtual ~AcceleratedSurface() { } | 37 virtual ~AcceleratedSurface(); |
38 | 38 |
39 // Set up internal buffers. |share_context|, if non-NULL, is a context | 39 // Set up internal buffers. |share_context|, if non-NULL, is a context |
40 // with which the internally created OpenGL context shares textures and | 40 // with which the internally created OpenGL context shares textures and |
41 // other resources. |allocate_fbo| indicates whether or not this surface | 41 // other resources. |allocate_fbo| indicates whether or not this surface |
42 // should allocate an offscreen frame buffer object (FBO) internally. If | 42 // should allocate an offscreen frame buffer object (FBO) internally. If |
43 // not, then the user is expected to allocate one. NOTE that allocating | 43 // not, then the user is expected to allocate one. NOTE that allocating |
44 // an FBO internally does NOT work properly with client code which uses | 44 // an FBO internally does NOT work properly with client code which uses |
45 // OpenGL (i.e., via GLES2 command buffers), because the GLES2 | 45 // OpenGL (i.e., via GLES2 command buffers), because the GLES2 |
46 // implementation does not know to bind the accelerated surface's | 46 // implementation does not know to bind the accelerated surface's |
47 // internal FBO when the default FBO is bound. Returns false upon | 47 // internal FBO when the default FBO is bound. Returns false upon |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // true. | 158 // true. |
159 GLuint fbo_; | 159 GLuint fbo_; |
160 GLuint depth_stencil_renderbuffer_; | 160 GLuint depth_stencil_renderbuffer_; |
161 // Allocate a TransportDIB in the renderer. | 161 // Allocate a TransportDIB in the renderer. |
162 scoped_ptr<Callback2<size_t, TransportDIB::Handle*>::Type> | 162 scoped_ptr<Callback2<size_t, TransportDIB::Handle*>::Type> |
163 dib_alloc_callback_; | 163 dib_alloc_callback_; |
164 scoped_ptr<Callback1<TransportDIB::Id>::Type> dib_free_callback_; | 164 scoped_ptr<Callback1<TransportDIB::Id>::Type> dib_free_callback_; |
165 }; | 165 }; |
166 | 166 |
167 #endif // APP_SURFACE_ACCELERATED_SURFACE_MAC_H_ | 167 #endif // APP_SURFACE_ACCELERATED_SURFACE_MAC_H_ |
OLD | NEW |