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

Unified Diff: content/common/gpu/image_transport_surface_overlay_mac.h

Issue 1251783002: Mac Overlays: Wire up overlays on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@part22
Patch Set: Leave widget type unchanged Created 5 years, 5 months 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: content/common/gpu/image_transport_surface_overlay_mac.h
diff --git a/content/common/gpu/image_transport_surface_overlay_mac.h b/content/common/gpu/image_transport_surface_overlay_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..66c0591f1ee365618d667be13d0aaefe99e5d24a
--- /dev/null
+++ b/content/common/gpu/image_transport_surface_overlay_mac.h
@@ -0,0 +1,70 @@
+// Copyright 2015 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 CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_
+#define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_
+
+#import "base/mac/scoped_nsobject.h"
+#include "content/common/gpu/gpu_command_buffer_stub.h"
+#include "content/common/gpu/image_transport_surface.h"
+#include "ui/gl/gl_surface.h"
+
+@class CAContext;
+@class CALayer;
+
+namespace content {
+
+class ImageTransportSurfaceOverlayMac : public gfx::GLSurface,
+ public ImageTransportSurface {
+ public:
+ ImageTransportSurfaceOverlayMac(GpuChannelManager* manager,
+ GpuCommandBufferStub* stub,
+ gfx::PluginWindowHandle handle);
+
+ // GLSurface implementation
+ bool Initialize() override;
+ void Destroy() override;
+ bool IsOffscreen() override;
+ gfx::SwapResult SwapBuffers() override;
+ gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override;
+ bool SupportsPostSubBuffer() override;
+ gfx::Size GetSize() override;
+ void* GetHandle() override;
+
+ bool ScheduleOverlayPlane(int z_order,
+ gfx::OverlayTransform transform,
+ gfx::GLImage* image,
+ const gfx::Rect& bounds_rect,
+ const gfx::RectF& crop_rect) override;
+ bool IsSurfaceless() const override;
+
+ // ImageTransportSurface implementation
+ void OnBufferPresented(
+ const AcceleratedSurfaceMsg_BufferPresented_Params& params) override;
+ void OnResize(gfx::Size pixel_size, float scale_factor) override;
+ void SetLatencyInfo(const std::vector<ui::LatencyInfo>&) override;
+ void WakeUpGpu() override;
+
+ private:
+ ~ImageTransportSurfaceOverlayMac() override;
+ scoped_ptr<ImageTransportHelper> helper_;
+ base::scoped_nsobject<CAContext> ca_context_;
+ base::scoped_nsobject<CALayer> layer_;
+
+ // A phony NSView handle used to identify this.
+ gfx::AcceleratedWidget widget_;
+
+ gfx::Size pixel_size_;
+ float scale_factor_;
+ std::vector<ui::LatencyInfo> latency_info_;
+
+ // Weak pointer to the image provided when ScheduleOverlayPlane is called. Is
+ // consumed and reset when SwapBuffers is called. For now, only one overlay
+ // plane is supported.
+ gfx::GLImage* pending_overlay_image_;
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_io_surface.cc ('k') | content/common/gpu/image_transport_surface_overlay_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698