| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/surface/transport_dib.h" | 10 #include "app/surface/transport_dib.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // available in Mac OS X 10.6; and, one for use with the | 78 // available in Mac OS X 10.6; and, one for use with the |
| 79 // TransportDIB-based version used on Mac OS X 10.5. | 79 // TransportDIB-based version used on Mac OS X 10.5. |
| 80 virtual uint64 SetWindowSizeForIOSurface(const gfx::Size& size); | 80 virtual uint64 SetWindowSizeForIOSurface(const gfx::Size& size); |
| 81 virtual TransportDIB::Handle SetWindowSizeForTransportDIB( | 81 virtual TransportDIB::Handle SetWindowSizeForTransportDIB( |
| 82 const gfx::Size& size); | 82 const gfx::Size& size); |
| 83 virtual void SetTransportDIBAllocAndFree( | 83 virtual void SetTransportDIBAllocAndFree( |
| 84 Callback2<size_t, TransportDIB::Handle*>::Type* allocator, | 84 Callback2<size_t, TransportDIB::Handle*>::Type* allocator, |
| 85 Callback1<TransportDIB::Id>::Type* deallocator); | 85 Callback1<TransportDIB::Id>::Type* deallocator); |
| 86 // Returns the id of the current IOSurface, or 0. | 86 // Returns the id of the current IOSurface, or 0. |
| 87 virtual uint64 GetSurfaceId(); | 87 virtual uint64 GetSurfaceId(); |
| 88 // To prevent the GPU process from overloading the browser process, |
| 89 // we need to track the number of swap buffers calls issued and |
| 90 // acknowledged per on-screen (IOSurface-backed) context, and keep |
| 91 // the GPU from getting too far ahead of the browser. Note that this |
| 92 // is also predicated on a flow control mechanism between the |
| 93 // renderer and GPU processes. |
| 94 uint64 swap_buffers_count() const; |
| 95 void set_acknowledged_swap_buffers_count( |
| 96 uint64 acknowledged_swap_buffers_count); |
| 88 #endif | 97 #endif |
| 89 | 98 |
| 90 // 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. |
| 91 // Must be called after Initialize(). | 100 // Must be called after Initialize(). |
| 92 // It is not defined on which thread this callback is called. | 101 // It is not defined on which thread this callback is called. |
| 93 virtual void SetSwapBuffersCallback(Callback0::Type* callback); | 102 virtual void SetSwapBuffersCallback(Callback0::Type* callback); |
| 94 | 103 |
| 95 // Get the GLES2Decoder associated with this processor. | 104 // Get the GLES2Decoder associated with this processor. |
| 96 gles2::GLES2Decoder* decoder() const { return decoder_.get(); } | 105 gles2::GLES2Decoder* decoder() const { return decoder_.get(); } |
| 97 | 106 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 115 // through the ProcessCommands callback. | 124 // through the ProcessCommands callback. |
| 116 CommandBuffer* command_buffer_; | 125 CommandBuffer* command_buffer_; |
| 117 | 126 |
| 118 int commands_per_update_; | 127 int commands_per_update_; |
| 119 | 128 |
| 120 scoped_ptr<gles2::GLES2Decoder> decoder_; | 129 scoped_ptr<gles2::GLES2Decoder> decoder_; |
| 121 scoped_ptr<CommandParser> parser_; | 130 scoped_ptr<CommandParser> parser_; |
| 122 | 131 |
| 123 #if defined(OS_MACOSX) | 132 #if defined(OS_MACOSX) |
| 124 scoped_ptr<AcceleratedSurface> surface_; | 133 scoped_ptr<AcceleratedSurface> surface_; |
| 134 uint64 swap_buffers_count_; |
| 135 uint64 acknowledged_swap_buffers_count_; |
| 125 #endif | 136 #endif |
| 126 | 137 |
| 127 ScopedRunnableMethodFactory<GPUProcessor> method_factory_; | 138 ScopedRunnableMethodFactory<GPUProcessor> method_factory_; |
| 128 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; | 139 scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_; |
| 129 }; | 140 }; |
| 130 | 141 |
| 131 } // namespace gpu | 142 } // namespace gpu |
| 132 | 143 |
| 133 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ | 144 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_PROCESSOR_H_ |
| OLD | NEW |