Chromium Code Reviews| 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..8d4897dc870b26efebe441bc46bce0a833531874 |
| --- /dev/null |
| +++ b/content/common/gpu/image_transport_surface_overlay_mac.h |
| @@ -0,0 +1,64 @@ |
| +// 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_ |
| + |
| +#include "base/mac/scoped_nsobject.h" |
|
Andre
2015/07/22 21:34:36
Use #import for an Obj-C header.
ccameron
2015/07/23 05:33:02
Done.
|
| +#include "content/common/gpu/gpu_command_buffer_stub.h" |
| +#include "content/common/gpu/image_transport_surface.h" |
| +#include "ui/base/cocoa/remote_layer_api.h" |
|
Andre
2015/07/22 21:34:36
Do we need this include here?
Can we just forward
ccameron
2015/07/23 05:33:02
Done.
|
| +#include "ui/gl/gl_surface.h" |
| + |
| +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_; |
| + |
| + gfx::Size pixel_size_; |
| + float scale_factor_; |
| + std::vector<ui::LatencyInfo> latency_info_; |
| + |
| + // This is set when ScheduleOverlayPlane is called, and is consumed when |
| + // SwapBuffers is called. For now, only one overlay plane is supported. |
| + gfx::GLImage* pending_overlay_image_; |
|
Andre
2015/07/22 21:34:36
Add weak comment?
ccameron
2015/07/23 05:33:02
Done.
|
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ |
|
Andre
2015/07/22 21:34:36
Comment is incorrect, should be CONTENT_COMMON_GPU
ccameron
2015/07/23 05:33:02
Done.
|