| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_ |
| 6 #define GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "gpu/command_buffer/common/texture_in_use_response.h" |
| 10 #include "gpu/gpu_export.h" |
| 11 #include "ui/events/latency_info.h" |
| 12 #include "ui/gfx/swap_result.h" |
| 13 |
| 14 #if defined(OS_MACOSX) |
| 15 #include "ui/base/cocoa/remote_layer_api.h" |
| 16 #include "ui/gfx/mac/io_surface.h" |
| 17 #endif |
| 18 |
| 19 namespace gpu { |
| 20 |
| 21 namespace gles2 { |
| 22 class FeatureInfo; |
| 23 } |
| 24 |
| 25 struct GPU_EXPORT SwapBuffersCompleteParams { |
| 26 SwapBuffersCompleteParams(); |
| 27 SwapBuffersCompleteParams(SwapBuffersCompleteParams&& other); |
| 28 ~SwapBuffersCompleteParams(); |
| 29 |
| 30 SwapBuffersCompleteParams& operator=(SwapBuffersCompleteParams&& other); |
| 31 |
| 32 #if defined(OS_MACOSX) |
| 33 // Mac-specific parameters used to present CALayers hosted in the GPU process. |
| 34 // TODO(ccameron): Remove these parameters once the CALayer tree is hosted in |
| 35 // the browser process. |
| 36 // https://crbug.com/604052 |
| 37 // Only one of ca_context_id or io_surface may be non-0. |
| 38 CAContextID ca_context_id; |
| 39 bool fullscreen_low_power_ca_context_valid; |
| 40 CAContextID fullscreen_low_power_ca_context_id; |
| 41 gfx::ScopedRefCountedIOSurfaceMachPort io_surface; |
| 42 gfx::Size pixel_size; |
| 43 float scale_factor; |
| 44 gpu::TextureInUseResponses in_use_responses; |
| 45 #endif |
| 46 std::vector<ui::LatencyInfo> latency_info; |
| 47 gfx::SwapResult result; |
| 48 }; |
| 49 |
| 50 class GPU_EXPORT ImageTransportSurfaceDelegate { |
| 51 public: |
| 52 // Tells the delete that SwapBuffers returned and passes latency info. |
| 53 virtual void DidSwapBuffersComplete(SwapBuffersCompleteParams params) = 0; |
| 54 |
| 55 // Returns the features available for the ContextGroup. |
| 56 virtual const gles2::FeatureInfo* GetFeatureInfo() const = 0; |
| 57 |
| 58 using LatencyInfoCallback = |
| 59 base::Callback<void(const std::vector<ui::LatencyInfo>&)>; |
| 60 // |callback| is called when the delegate has updated LatencyInfo available. |
| 61 virtual void SetLatencyInfoCallback(const LatencyInfoCallback& callback) = 0; |
| 62 |
| 63 // Informs the delegate about updated vsync parameters. |
| 64 virtual void UpdateVSyncParameters(base::TimeTicks timebase, |
| 65 base::TimeDelta interval) = 0; |
| 66 |
| 67 protected: |
| 68 virtual ~ImageTransportSurfaceDelegate() {} |
| 69 }; |
| 70 |
| 71 } // namespace gpu |
| 72 |
| 73 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_ |
| OLD | NEW |