| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMPOSITOR_COMPOSITOR_H_ | 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_ |
| 6 #define UI_COMPOSITOR_COMPOSITOR_H_ | 6 #define UI_COMPOSITOR_COMPOSITOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // main thread. | 145 // main thread. |
| 146 virtual scoped_refptr<cc::ContextProvider> | 146 virtual scoped_refptr<cc::ContextProvider> |
| 147 SharedMainThreadContextProvider() = 0; | 147 SharedMainThreadContextProvider() = 0; |
| 148 | 148 |
| 149 // Destroys per-compositor data. | 149 // Destroys per-compositor data. |
| 150 virtual void RemoveCompositor(Compositor* compositor) = 0; | 150 virtual void RemoveCompositor(Compositor* compositor) = 0; |
| 151 | 151 |
| 152 // Returns refresh rate. Tests may return higher values. | 152 // Returns refresh rate. Tests may return higher values. |
| 153 virtual double GetRefreshRate() const = 0; | 153 virtual double GetRefreshRate() const = 0; |
| 154 | 154 |
| 155 // Returns the OpenGL target to use for image textures. | |
| 156 virtual uint32_t GetImageTextureTarget(gfx::BufferFormat format, | |
| 157 gfx::BufferUsage usage) = 0; | |
| 158 | |
| 159 // Gets the GPU memory buffer manager. | 155 // Gets the GPU memory buffer manager. |
| 160 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; | 156 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; |
| 161 | 157 |
| 162 // Gets the task graph runner. | 158 // Gets the task graph runner. |
| 163 virtual cc::TaskGraphRunner* GetTaskGraphRunner() = 0; | 159 virtual cc::TaskGraphRunner* GetTaskGraphRunner() = 0; |
| 164 | 160 |
| 161 // Gets the renderer settings. |
| 162 virtual const cc::RendererSettings& GetRendererSettings() const = 0; |
| 163 |
| 165 virtual void AddObserver(ContextFactoryObserver* observer) = 0; | 164 virtual void AddObserver(ContextFactoryObserver* observer) = 0; |
| 166 | 165 |
| 167 virtual void RemoveObserver(ContextFactoryObserver* observer) = 0; | 166 virtual void RemoveObserver(ContextFactoryObserver* observer) = 0; |
| 168 }; | 167 }; |
| 169 | 168 |
| 170 // Compositor object to take care of GPU painting. | 169 // Compositor object to take care of GPU painting. |
| 171 // A Browser compositor object is responsible for generating the final | 170 // A Browser compositor object is responsible for generating the final |
| 172 // displayable form of pixels comprising a single widget's contents. It draws an | 171 // displayable form of pixels comprising a single widget's contents. It draws an |
| 173 // appropriately transformed texture for each transformed view in the widget's | 172 // appropriately transformed texture for each transformed view in the widget's |
| 174 // view hierarchy. | 173 // view hierarchy. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 // cc::LayerTreeHostSingleThreadClient implementation. | 347 // cc::LayerTreeHostSingleThreadClient implementation. |
| 349 void DidSubmitCompositorFrame() override; | 348 void DidSubmitCompositorFrame() override; |
| 350 void DidLoseCompositorFrameSink() override {} | 349 void DidLoseCompositorFrameSink() override {} |
| 351 | 350 |
| 352 bool IsLocked() { return !active_locks_.empty(); } | 351 bool IsLocked() { return !active_locks_.empty(); } |
| 353 | 352 |
| 354 void SetOutputIsSecure(bool output_is_secure); | 353 void SetOutputIsSecure(bool output_is_secure); |
| 355 | 354 |
| 356 const cc::LayerTreeDebugState& GetLayerTreeDebugState() const; | 355 const cc::LayerTreeDebugState& GetLayerTreeDebugState() const; |
| 357 void SetLayerTreeDebugState(const cc::LayerTreeDebugState& debug_state); | 356 void SetLayerTreeDebugState(const cc::LayerTreeDebugState& debug_state); |
| 358 const cc::RendererSettings& GetRendererSettings() const; | |
| 359 | 357 |
| 360 LayerAnimatorCollection* layer_animator_collection() { | 358 LayerAnimatorCollection* layer_animator_collection() { |
| 361 return &layer_animator_collection_; | 359 return &layer_animator_collection_; |
| 362 } | 360 } |
| 363 | 361 |
| 364 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } | 362 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } |
| 365 int activated_frame_count() const { return activated_frame_count_; } | 363 int activated_frame_count() const { return activated_frame_count_; } |
| 366 float refresh_rate() const { return refresh_rate_; } | 364 float refresh_rate() const { return refresh_rate_; } |
| 367 | 365 |
| 368 void set_allow_locks_to_extend_timeout(bool allowed) { | 366 void set_allow_locks_to_extend_timeout(bool allowed) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 | 427 |
| 430 base::WeakPtrFactory<Compositor> weak_ptr_factory_; | 428 base::WeakPtrFactory<Compositor> weak_ptr_factory_; |
| 431 base::WeakPtrFactory<Compositor> lock_timeout_weak_ptr_factory_; | 429 base::WeakPtrFactory<Compositor> lock_timeout_weak_ptr_factory_; |
| 432 | 430 |
| 433 DISALLOW_COPY_AND_ASSIGN(Compositor); | 431 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 434 }; | 432 }; |
| 435 | 433 |
| 436 } // namespace ui | 434 } // namespace ui |
| 437 | 435 |
| 438 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 436 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |