| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CLIENT_CONTEXT_SUPPORT_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ |
| 6 #define GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 11 #include "ui/gfx/overlay_transform.h" | 12 #include "ui/gfx/overlay_transform.h" |
| 12 | 13 |
| 13 namespace gfx { | 14 namespace gfx { |
| 14 class Rect; | 15 class Rect; |
| 15 class RectF; | 16 class RectF; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace gpu { | 19 namespace gpu { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 34 // passed the glEndQueryEXT() point. | 35 // passed the glEndQueryEXT() point. |
| 35 virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; | 36 virtual void SignalQuery(uint32_t query, const base::Closure& callback) = 0; |
| 36 | 37 |
| 37 // Indicates whether the context should aggressively free allocated resources. | 38 // Indicates whether the context should aggressively free allocated resources. |
| 38 // If set to true, the context will purge all temporary resources when | 39 // If set to true, the context will purge all temporary resources when |
| 39 // flushed. | 40 // flushed. |
| 40 virtual void SetAggressivelyFreeResources( | 41 virtual void SetAggressivelyFreeResources( |
| 41 bool aggressively_free_resources) = 0; | 42 bool aggressively_free_resources) = 0; |
| 42 | 43 |
| 43 virtual void Swap() = 0; | 44 virtual void Swap() = 0; |
| 44 virtual void SwapWithDamage(const gfx::Rect& damage) = 0; | 45 virtual void SwapWithBounds(const std::vector<gfx::Rect>& rects) = 0; |
| 45 virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) = 0; | 46 virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) = 0; |
| 46 virtual void CommitOverlayPlanes() = 0; | 47 virtual void CommitOverlayPlanes() = 0; |
| 47 | 48 |
| 48 // Schedule a texture to be presented as an overlay synchronously with the | 49 // Schedule a texture to be presented as an overlay synchronously with the |
| 49 // primary surface during the next buffer swap or CommitOverlayPlanes. | 50 // primary surface during the next buffer swap or CommitOverlayPlanes. |
| 50 // This method is not stateful and needs to be re-scheduled every frame. | 51 // This method is not stateful and needs to be re-scheduled every frame. |
| 51 virtual void ScheduleOverlayPlane(int plane_z_order, | 52 virtual void ScheduleOverlayPlane(int plane_z_order, |
| 52 gfx::OverlayTransform plane_transform, | 53 gfx::OverlayTransform plane_transform, |
| 53 unsigned overlay_texture_id, | 54 unsigned overlay_texture_id, |
| 54 const gfx::Rect& display_bounds, | 55 const gfx::Rect& display_bounds, |
| 55 const gfx::RectF& uv_rect) = 0; | 56 const gfx::RectF& uv_rect) = 0; |
| 56 | 57 |
| 57 // Returns an ID that can be used to globally identify the share group that | 58 // Returns an ID that can be used to globally identify the share group that |
| 58 // this context's resources belong to. | 59 // this context's resources belong to. |
| 59 virtual uint64_t ShareGroupTracingGUID() const = 0; | 60 virtual uint64_t ShareGroupTracingGUID() const = 0; |
| 60 | 61 |
| 61 // Sets a callback to be run when an error occurs. | 62 // Sets a callback to be run when an error occurs. |
| 62 virtual void SetErrorMessageCallback( | 63 virtual void SetErrorMessageCallback( |
| 63 const base::Callback<void(const char*, int32_t)>& callback) = 0; | 64 const base::Callback<void(const char*, int32_t)>& callback) = 0; |
| 64 | 65 |
| 65 protected: | 66 protected: |
| 66 ContextSupport() {} | 67 ContextSupport() {} |
| 67 virtual ~ContextSupport() {} | 68 virtual ~ContextSupport() {} |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } | 71 } |
| 71 | 72 |
| 72 #endif // GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ | 73 #endif // GPU_COMMAND_BUFFER_CLIENT_CONTEXT_SUPPORT_H_ |
| OLD | NEW |