| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_ | 5 #ifndef GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_ |
| 6 #define GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_ | 6 #define GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "gpu/command_buffer/common/texture_in_use_response.h" | 9 #include "gpu/command_buffer/common/texture_in_use_response.h" |
| 10 #include "gpu/gpu_export.h" | 10 #include "gpu/gpu_export.h" |
| 11 #include "gpu/ipc/common/surface_handle.h" |
| 11 #include "ui/events/latency_info.h" | 12 #include "ui/events/latency_info.h" |
| 12 #include "ui/gfx/swap_result.h" | 13 #include "ui/gfx/swap_result.h" |
| 13 | 14 |
| 14 #if defined(OS_MACOSX) | 15 #if defined(OS_MACOSX) |
| 15 #include "ui/base/cocoa/remote_layer_api.h" | 16 #include "ui/base/cocoa/remote_layer_api.h" |
| 16 #include "ui/gfx/mac/io_surface.h" | 17 #include "ui/gfx/mac/io_surface.h" |
| 17 #endif | 18 #endif |
| 18 | 19 |
| 19 namespace gpu { | 20 namespace gpu { |
| 20 | 21 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 42 gfx::Size pixel_size; | 43 gfx::Size pixel_size; |
| 43 float scale_factor; | 44 float scale_factor; |
| 44 gpu::TextureInUseResponses in_use_responses; | 45 gpu::TextureInUseResponses in_use_responses; |
| 45 #endif | 46 #endif |
| 46 std::vector<ui::LatencyInfo> latency_info; | 47 std::vector<ui::LatencyInfo> latency_info; |
| 47 gfx::SwapResult result; | 48 gfx::SwapResult result; |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 class GPU_EXPORT ImageTransportSurfaceDelegate { | 51 class GPU_EXPORT ImageTransportSurfaceDelegate { |
| 51 public: | 52 public: |
| 52 // Tells the delete that SwapBuffers returned and passes latency info. | 53 #if defined(OS_WIN) |
| 54 // Tells the delegate that a child window was created with the provided |
| 55 // SurfaceHandle. |
| 56 virtual void DidCreateAcceleratedSurfaceChildWindow( |
| 57 SurfaceHandle parent_window, |
| 58 SurfaceHandle child_window) = 0; |
| 59 #endif |
| 60 |
| 61 // Tells the delegate that SwapBuffers returned and passes latency info. |
| 53 virtual void DidSwapBuffersComplete(SwapBuffersCompleteParams params) = 0; | 62 virtual void DidSwapBuffersComplete(SwapBuffersCompleteParams params) = 0; |
| 54 | 63 |
| 55 // Returns the features available for the ContextGroup. | 64 // Returns the features available for the ContextGroup. |
| 56 virtual const gles2::FeatureInfo* GetFeatureInfo() const = 0; | 65 virtual const gles2::FeatureInfo* GetFeatureInfo() const = 0; |
| 57 | 66 |
| 58 using LatencyInfoCallback = | 67 using LatencyInfoCallback = |
| 59 base::Callback<void(const std::vector<ui::LatencyInfo>&)>; | 68 base::Callback<void(const std::vector<ui::LatencyInfo>&)>; |
| 60 // |callback| is called when the delegate has updated LatencyInfo available. | 69 // |callback| is called when the delegate has updated LatencyInfo available. |
| 61 virtual void SetLatencyInfoCallback(const LatencyInfoCallback& callback) = 0; | 70 virtual void SetLatencyInfoCallback(const LatencyInfoCallback& callback) = 0; |
| 62 | 71 |
| 63 // Informs the delegate about updated vsync parameters. | 72 // Informs the delegate about updated vsync parameters. |
| 64 virtual void UpdateVSyncParameters(base::TimeTicks timebase, | 73 virtual void UpdateVSyncParameters(base::TimeTicks timebase, |
| 65 base::TimeDelta interval) = 0; | 74 base::TimeDelta interval) = 0; |
| 66 | 75 |
| 67 protected: | 76 protected: |
| 68 virtual ~ImageTransportSurfaceDelegate() {} | 77 virtual ~ImageTransportSurfaceDelegate() {} |
| 69 }; | 78 }; |
| 70 | 79 |
| 71 } // namespace gpu | 80 } // namespace gpu |
| 72 | 81 |
| 73 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_ | 82 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_ |
| OLD | NEW |