Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Unified Diff: gpu/ipc/service/image_transport_surface_delegate.h

Issue 2492583002: Decouple PassThroughImageTransportSurface from GpuCommandBufferStub (Closed)
Patch Set: Addressed Antoine's comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/ipc/service/image_transport_surface_delegate.h
diff --git a/gpu/ipc/service/image_transport_surface_delegate.h b/gpu/ipc/service/image_transport_surface_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..c8ad53bdb9151642b33abafebb6dedecf8fce44b
--- /dev/null
+++ b/gpu/ipc/service/image_transport_surface_delegate.h
@@ -0,0 +1,73 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_
+#define GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_
+
+#include "base/callback.h"
+#include "gpu/command_buffer/common/texture_in_use_response.h"
+#include "gpu/gpu_export.h"
+#include "ui/events/latency_info.h"
+#include "ui/gfx/swap_result.h"
+
+#if defined(OS_MACOSX)
+#include "ui/base/cocoa/remote_layer_api.h"
+#include "ui/gfx/mac/io_surface.h"
+#endif
+
+namespace gpu {
+
+namespace gles2 {
+class FeatureInfo;
+}
+
+struct GPU_EXPORT SwapBuffersCompleteParams {
+ SwapBuffersCompleteParams();
+ SwapBuffersCompleteParams(SwapBuffersCompleteParams&& other);
+ ~SwapBuffersCompleteParams();
+
+ SwapBuffersCompleteParams& operator=(SwapBuffersCompleteParams&& other);
+
+#if defined(OS_MACOSX)
+ // Mac-specific parameters used to present CALayers hosted in the GPU process.
+ // TODO(ccameron): Remove these parameters once the CALayer tree is hosted in
+ // the browser process.
+ // https://crbug.com/604052
+ // Only one of ca_context_id or io_surface may be non-0.
+ CAContextID ca_context_id;
+ bool fullscreen_low_power_ca_context_valid;
+ CAContextID fullscreen_low_power_ca_context_id;
+ gfx::ScopedRefCountedIOSurfaceMachPort io_surface;
+ gfx::Size pixel_size;
+ float scale_factor;
+ gpu::TextureInUseResponses in_use_responses;
+#endif
+ std::vector<ui::LatencyInfo> latency_info;
+ gfx::SwapResult result;
+};
+
+class GPU_EXPORT ImageTransportSurfaceDelegate {
+ public:
+ // Tells the delete that SwapBuffers returned and passes latency info.
+ virtual void DidSwapBuffersComplete(SwapBuffersCompleteParams params) = 0;
+
+ // Returns the features available for the ContextGroup.
+ virtual const gles2::FeatureInfo* GetFeatureInfo() const = 0;
+
+ using LatencyInfoCallback =
+ base::Callback<void(const std::vector<ui::LatencyInfo>&)>;
+ // |callback| is called when the delegate has updated LatencyInfo available.
+ virtual void SetLatencyInfoCallback(const LatencyInfoCallback& callback) = 0;
+
+ // Informs the delegate about updated vsync parameters.
+ virtual void UpdateVSyncParameters(base::TimeTicks timebase,
+ base::TimeDelta interval) = 0;
+
+ protected:
+ virtual ~ImageTransportSurfaceDelegate() {}
+};
+
+} // namespace gpu
+
+#endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_DELEGATE_H_
« no previous file with comments | « gpu/ipc/service/image_transport_surface_android.cc ('k') | gpu/ipc/service/image_transport_surface_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698