Chromium Code Reviews| 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 CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_MAC_H_ | |
| 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_MAC_H_ | |
| 7 | |
| 8 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s urface.h" | |
| 9 | |
| 10 namespace content { | |
| 11 | |
| 12 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
| |
| 13 : public GpuSurfacelessBrowserCompositorOutputSurface { | |
| 14 public: | |
| 15 GpuBrowserCompositorOutputSurfaceMac( | |
| 16 scoped_refptr<ContextProviderCommandBuffer> context, | |
| 17 gpu::SurfaceHandle surface_handle, | |
| 18 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, | |
| 19 base::SingleThreadTaskRunner* task_runner, | |
| 20 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager); | |
| 21 ~GpuBrowserCompositorOutputSurfaceMac() override; | |
| 22 | |
| 23 // cc::OutputSurface implementation. | |
| 24 void SwapBuffers(cc::CompositorFrame* frame) override; | |
| 25 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.
| |
| 26 bool SurfaceIsSuspendForRecycle() const override; | |
| 27 | |
| 28 // BrowserCompositorOutputSurface implementation. | |
| 29 void OnGpuSwapBuffersCompleted( | |
| 30 const std::vector<ui::LatencyInfo>& latency_info, | |
| 31 gfx::SwapResult result, | |
| 32 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) override; | |
| 33 | |
| 34 private: | |
| 35 enum ShouldShowFramesState { | |
| 36 // Frames that come from the GPU process should appear on-screen. | |
| 37 SHOULD_SHOW_FRAMES, | |
| 38 // The compositor has been suspended. Any frames that come from the GPU | |
| 39 // process are for the pre-suspend content and should not be displayed. | |
| 40 SHOULD_NOT_SHOW_FRAMES_SUSPENDED, | |
| 41 // The compositor has been un-suspended, but has not yet issued a swap | |
| 42 // since being un-suspended, so any frames that come from the GPU process | |
| 43 // are for pre-suspend content and should not be displayed. | |
| 44 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED, | |
| 45 }; | |
| 46 ShouldShowFramesState should_show_frames_state_ = SHOULD_SHOW_FRAMES; | |
| 47 }; | |
| 48 | |
| 49 } // namespace content | |
| 50 | |
| 51 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_MAC_ H_ | |
| OLD | NEW |