| 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ |
| 7 | 7 |
| 8 #include "app/gfx/native_widget_types.h" | 8 #include "app/gfx/native_widget_types.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 virtual void Destroy(); | 37 virtual void Destroy(); |
| 38 | 38 |
| 39 virtual void ProcessCommands(); | 39 virtual void ProcessCommands(); |
| 40 | 40 |
| 41 // Implementation of CommandBufferEngine. | 41 // Implementation of CommandBufferEngine. |
| 42 virtual Buffer GetSharedMemoryBuffer(int32 shm_id); | 42 virtual Buffer GetSharedMemoryBuffer(int32 shm_id); |
| 43 virtual void set_token(int32 token); | 43 virtual void set_token(int32 token); |
| 44 virtual bool SetGetOffset(int32 offset); | 44 virtual bool SetGetOffset(int32 offset); |
| 45 virtual int32 GetGetOffset(); | 45 virtual int32 GetGetOffset(); |
| 46 | 46 |
| 47 #if defined(OS_MACOSX) |
| 48 // Needed only on Mac OS X, which does not render into an on-screen |
| 49 // window and therefore requires the backing store to be resized |
| 50 // manually. Returns an opaque identifier for the new backing store. |
| 51 virtual uint64 SetWindowSize(int32 width, int32 height); |
| 52 |
| 53 #endif |
| 54 |
| 55 // Sets a callback which is called when a SwapBuffers command is processed. |
| 56 // Must be called after Initialize(). |
| 57 // It is not defined on which thread this callback is called. |
| 58 virtual void SetSwapBuffersCallback(Callback0::Type* callback); |
| 59 |
| 47 private: | 60 private: |
| 48 // The GPUProcessor holds a weak reference to the CommandBuffer. The | 61 // The GPUProcessor holds a weak reference to the CommandBuffer. The |
| 49 // CommandBuffer owns the GPUProcessor and holds a strong reference to it | 62 // CommandBuffer owns the GPUProcessor and holds a strong reference to it |
| 50 // through the ProcessCommands callback. | 63 // through the ProcessCommands callback. |
| 51 CommandBuffer* command_buffer_; | 64 CommandBuffer* command_buffer_; |
| 52 | 65 |
| 53 scoped_ptr< ::base::SharedMemory> mapped_ring_buffer_; | 66 scoped_ptr< ::base::SharedMemory> mapped_ring_buffer_; |
| 54 int commands_per_update_; | 67 int commands_per_update_; |
| 55 | 68 |
| 56 scoped_ptr<gles2::GLES2Decoder> decoder_; | 69 scoped_ptr<gles2::GLES2Decoder> decoder_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 76 | 89 |
| 77 protected: | 90 protected: |
| 78 gpu::GPUProcessor* obj_; | 91 gpu::GPUProcessor* obj_; |
| 79 Method meth_; | 92 Method meth_; |
| 80 | 93 |
| 81 private: | 94 private: |
| 82 DISALLOW_COPY_AND_ASSIGN(CallbackStorage); | 95 DISALLOW_COPY_AND_ASSIGN(CallbackStorage); |
| 83 }; | 96 }; |
| 84 | 97 |
| 85 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ | 98 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ |
| OLD | NEW |