| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This file contains the GLES2Decoder class. | 5 // This file contains the GLES2Decoder class. |
| 6 | 6 |
| 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| 9 | 9 |
| 10 #include <build/build_config.h> | 10 #include <build/build_config.h> |
| 11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
| 12 #include <windows.h> | 12 #include <windows.h> |
| 13 #endif | 13 #endif |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #if defined(OS_MACOSX) | 15 #if defined(OS_MACOSX) |
| 16 #include "app/surface/transport_dib.h" | 16 #include "app/surface/transport_dib.h" |
| 17 #endif | 17 #endif |
| 18 |
| 19 #include "gfx/size.h" |
| 18 #include "gpu/command_buffer/service/common_decoder.h" | 20 #include "gpu/command_buffer/service/common_decoder.h" |
| 19 | 21 |
| 20 | 22 |
| 21 namespace gpu { | 23 namespace gpu { |
| 22 // Forward-declared instead of including x_utils.h, because including glx.h | 24 // Forward-declared instead of including x_utils.h, because including glx.h |
| 23 // causes havok. | 25 // causes havok. |
| 24 class XWindowWrapper; | 26 class XWindowWrapper; |
| 25 | 27 |
| 26 namespace gles2 { | 28 namespace gles2 { |
| 27 | 29 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 66 } |
| 65 #elif defined(OS_MACOSX) | 67 #elif defined(OS_MACOSX) |
| 66 virtual uint64 SetWindowSizeForIOSurface(int32 width, int32 height) = 0; | 68 virtual uint64 SetWindowSizeForIOSurface(int32 width, int32 height) = 0; |
| 67 virtual TransportDIB::Handle SetWindowSizeForTransportDIB(int32 width, | 69 virtual TransportDIB::Handle SetWindowSizeForTransportDIB(int32 width, |
| 68 int32 height) = 0; | 70 int32 height) = 0; |
| 69 virtual void SetTransportDIBAllocAndFree( | 71 virtual void SetTransportDIBAllocAndFree( |
| 70 Callback2<size_t, TransportDIB::Handle*>::Type* allocator, | 72 Callback2<size_t, TransportDIB::Handle*>::Type* allocator, |
| 71 Callback1<TransportDIB::Id>::Type* deallocator) = 0; | 73 Callback1<TransportDIB::Id>::Type* deallocator) = 0; |
| 72 #endif | 74 #endif |
| 73 | 75 |
| 74 // Initializes the graphics context. | 76 // Initializes the graphics context. Can create an offscreen |
| 77 // decoder with a frame buffer that can be referenced from the parent. |
| 75 // Returns: | 78 // Returns: |
| 76 // true if successful. | 79 // true if successful. |
| 77 virtual bool Initialize() = 0; | 80 virtual bool Initialize(GLES2Decoder* parent, |
| 81 const gfx::Size& size, |
| 82 uint32 parent_texture_id) = 0; |
| 78 | 83 |
| 79 // Destroys the graphics context. | 84 // Destroys the graphics context. |
| 80 virtual void Destroy() = 0; | 85 virtual void Destroy() = 0; |
| 81 | 86 |
| 87 // Resize an offscreen frame buffer. |
| 88 virtual void ResizeOffscreenFrameBuffer(const gfx::Size& size) = 0; |
| 89 |
| 82 // Make this decoder's GL context current. | 90 // Make this decoder's GL context current. |
| 83 virtual bool MakeCurrent() = 0; | 91 virtual bool MakeCurrent() = 0; |
| 84 | 92 |
| 85 // Gets a service id by client id. | 93 // Gets a service id by client id. |
| 86 virtual uint32 GetServiceIdForTesting(uint32 client_id) = 0; | 94 virtual uint32 GetServiceIdForTesting(uint32 client_id) = 0; |
| 87 | 95 |
| 88 // Gets the GLES2 Util which holds info. | 96 // Gets the GLES2 Util which holds info. |
| 89 virtual GLES2Util* GetGLES2Util() = 0; | 97 virtual GLES2Util* GetGLES2Util() = 0; |
| 90 | 98 |
| 91 // Sets a callback which is called when a SwapBuffers command is processed. | 99 // Sets a callback which is called when a SwapBuffers command is processed. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 106 HWND hwnd_; | 114 HWND hwnd_; |
| 107 #endif | 115 #endif |
| 108 | 116 |
| 109 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); | 117 DISALLOW_COPY_AND_ASSIGN(GLES2Decoder); |
| 110 }; | 118 }; |
| 111 | 119 |
| 112 } // namespace gles2 | 120 } // namespace gles2 |
| 113 } // namespace gpu | 121 } // namespace gpu |
| 114 | 122 |
| 115 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ | 123 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_H_ |
| OLD | NEW |