| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_ | 5 #ifndef UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_ |
| 6 #define UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_ | 6 #define UI_GFX_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 |
| 11 #include "base/callback_old.h" | 11 #include "base/callback_old.h" |
| 12 #include "base/mac/scoped_cftyperef.h" | 12 #include "base/mac/scoped_cftyperef.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
| 15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
| 16 #include "ui/gfx/gl/gl_context.h" | 16 #include "ui/gfx/gl/gl_context.h" |
| 17 #include "ui/gfx/gl/gl_surface.h" | 17 #include "ui/gfx/gl/gl_surface.h" |
| 18 #include "ui/gfx/surface/surface_export.h" |
| 18 #include "ui/gfx/surface/transport_dib.h" | 19 #include "ui/gfx/surface/transport_dib.h" |
| 19 | 20 |
| 20 // Should not include GL headers in a header file. Forward declare these types | 21 // Should not include GL headers in a header file. Forward declare these types |
| 21 // instead. | 22 // instead. |
| 22 typedef struct _CGLContextObject* CGLContextObj; | 23 typedef struct _CGLContextObject* CGLContextObj; |
| 23 typedef unsigned int GLenum; | 24 typedef unsigned int GLenum; |
| 24 typedef unsigned int GLuint; | 25 typedef unsigned int GLuint; |
| 25 | 26 |
| 26 namespace gfx { | 27 namespace gfx { |
| 27 class Rect; | 28 class Rect; |
| 28 } | 29 } |
| 29 | 30 |
| 30 // Encapsulates an accelerated GL surface that can be shared across processes | 31 // Encapsulates an accelerated GL surface that can be shared across processes |
| 31 // on systems that support it (10.6 and above). For systems that do not, it | 32 // on systems that support it (10.6 and above). For systems that do not, it |
| 32 // uses a regular dib. There will either be an IOSurface or a TransportDIB, | 33 // uses a regular dib. There will either be an IOSurface or a TransportDIB, |
| 33 // never both. | 34 // never both. |
| 34 | 35 |
| 35 class AcceleratedSurface { | 36 class SURFACE_EXPORT AcceleratedSurface { |
| 36 public: | 37 public: |
| 37 AcceleratedSurface(); | 38 AcceleratedSurface(); |
| 38 virtual ~AcceleratedSurface(); | 39 virtual ~AcceleratedSurface(); |
| 39 | 40 |
| 40 // Set up internal buffers. |share_context|, if non-NULL, is a context | 41 // Set up internal buffers. |share_context|, if non-NULL, is a context |
| 41 // with which the internally created OpenGL context shares textures and | 42 // with which the internally created OpenGL context shares textures and |
| 42 // other resources. |allocate_fbo| indicates whether or not this surface | 43 // other resources. |allocate_fbo| indicates whether or not this surface |
| 43 // should allocate an offscreen frame buffer object (FBO) internally. If | 44 // should allocate an offscreen frame buffer object (FBO) internally. If |
| 44 // not, then the user is expected to allocate one. NOTE that allocating | 45 // not, then the user is expected to allocate one. NOTE that allocating |
| 45 // an FBO internally does NOT work properly with client code which uses | 46 // an FBO internally does NOT work properly with client code which uses |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // true. | 168 // true. |
| 168 GLuint fbo_; | 169 GLuint fbo_; |
| 169 GLuint depth_stencil_renderbuffer_; | 170 GLuint depth_stencil_renderbuffer_; |
| 170 // Allocate a TransportDIB in the renderer. | 171 // Allocate a TransportDIB in the renderer. |
| 171 scoped_ptr<Callback2<size_t, TransportDIB::Handle*>::Type> | 172 scoped_ptr<Callback2<size_t, TransportDIB::Handle*>::Type> |
| 172 dib_alloc_callback_; | 173 dib_alloc_callback_; |
| 173 scoped_ptr<Callback1<TransportDIB::Id>::Type> dib_free_callback_; | 174 scoped_ptr<Callback1<TransportDIB::Id>::Type> dib_free_callback_; |
| 174 }; | 175 }; |
| 175 | 176 |
| 176 #endif // UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_ | 177 #endif // UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_ |
| OLD | NEW |