Chromium Code Reviews| Index: content/browser/compositor/gpu_browser_compositor_output_surface_mac.h |
| diff --git a/content/browser/compositor/gpu_browser_compositor_output_surface_mac.h b/content/browser/compositor/gpu_browser_compositor_output_surface_mac.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0314d7b49c870bbefba34a9f63d1d020cb47f75e |
| --- /dev/null |
| +++ b/content/browser/compositor/gpu_browser_compositor_output_surface_mac.h |
| @@ -0,0 +1,51 @@ |
| +// 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 CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_MAC_H_ |
| +#define CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_MAC_H_ |
| + |
| +#include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h" |
| + |
| +namespace content { |
| + |
| +class GpuBrowserCompositorOutputSurfaceMac |
|
danakj
2016/05/26 21:33:51
GpuSurfacelessBrowserCompositorOutputSurfaceMac ?
ccameron
2016/05/26 22:46:16
I was contemplating this -- I've changed it to Gpu
|
| + : public GpuSurfacelessBrowserCompositorOutputSurface { |
| + public: |
| + GpuBrowserCompositorOutputSurfaceMac( |
| + scoped_refptr<ContextProviderCommandBuffer> context, |
| + gpu::SurfaceHandle surface_handle, |
| + scoped_refptr<ui::CompositorVSyncManager> vsync_manager, |
| + base::SingleThreadTaskRunner* task_runner, |
| + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); |
| + ~GpuBrowserCompositorOutputSurfaceMac() override; |
| + |
| + // cc::OutputSurface implementation. |
| + void SwapBuffers(cc::CompositorFrame* frame) override; |
| + void SetSurfaceSuspendedForRecycle(bool suspended) override; |
|
danakj
2016/05/26 21:33:51
This is from BrowserCompositorOutputSurface, not c
ccameron
2016/05/26 22:46:16
Oops! Moved.
|
| + bool SurfaceIsSuspendForRecycle() const override; |
| + |
| + // BrowserCompositorOutputSurface implementation. |
| + void OnGpuSwapBuffersCompleted( |
| + const std::vector<ui::LatencyInfo>& latency_info, |
| + gfx::SwapResult result, |
| + const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) override; |
| + |
| + private: |
| + enum ShouldShowFramesState { |
| + // Frames that come from the GPU process should appear on-screen. |
| + SHOULD_SHOW_FRAMES, |
| + // The compositor has been suspended. Any frames that come from the GPU |
| + // process are for the pre-suspend content and should not be displayed. |
| + SHOULD_NOT_SHOW_FRAMES_SUSPENDED, |
| + // The compositor has been un-suspended, but has not yet issued a swap |
| + // since being un-suspended, so any frames that come from the GPU process |
| + // are for pre-suspend content and should not be displayed. |
| + SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED, |
| + }; |
| + ShouldShowFramesState should_show_frames_state_ = SHOULD_SHOW_FRAMES; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_MAC_H_ |