| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
| 6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "cc/output/output_surface.h" | 11 #include "cc/output/output_surface.h" |
| 12 #include "cc/scheduler/begin_frame_source.h" | 12 #include "cc/scheduler/begin_frame_source.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "ui/compositor/compositor_vsync_manager.h" | 14 #include "ui/compositor/compositor_vsync_manager.h" |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 class SoftwareOutputDevice; | 17 class SoftwareOutputDevice; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace display_compositor { | 20 namespace display_compositor { |
| 21 class CompositorOverlayCandidateValidator; | 21 class CompositorOverlayCandidateValidator; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace gfx { | 24 namespace gfx { |
| 25 enum class SwapResult; | 25 enum class SwapResult; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace gpu { |
| 29 struct GpuProcessHostedCALayerTreeParamsMac; |
| 30 } |
| 31 |
| 28 namespace content { | 32 namespace content { |
| 29 class ContextProviderCommandBuffer; | 33 class ContextProviderCommandBuffer; |
| 30 class ReflectorImpl; | 34 class ReflectorImpl; |
| 31 class WebGraphicsContext3DCommandBufferImpl; | 35 class WebGraphicsContext3DCommandBufferImpl; |
| 32 | 36 |
| 33 class CONTENT_EXPORT BrowserCompositorOutputSurface | 37 class CONTENT_EXPORT BrowserCompositorOutputSurface |
| 34 : public cc::OutputSurface, | 38 : public cc::OutputSurface, |
| 35 public ui::CompositorVSyncManager::Observer { | 39 public ui::CompositorVSyncManager::Observer { |
| 36 public: | 40 public: |
| 37 ~BrowserCompositorOutputSurface() override; | 41 ~BrowserCompositorOutputSurface() override; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 50 void SetReflector(ReflectorImpl* reflector); | 54 void SetReflector(ReflectorImpl* reflector); |
| 51 | 55 |
| 52 // Called when |reflector_| was updated. | 56 // Called when |reflector_| was updated. |
| 53 virtual void OnReflectorChanged(); | 57 virtual void OnReflectorChanged(); |
| 54 | 58 |
| 55 // Returns a callback that will be called when all mirroring | 59 // Returns a callback that will be called when all mirroring |
| 56 // compositors have started composition. | 60 // compositors have started composition. |
| 57 virtual base::Closure CreateCompositionStartedCallback(); | 61 virtual base::Closure CreateCompositionStartedCallback(); |
| 58 | 62 |
| 59 // Called when a swap completion is sent from the GPU process. | 63 // Called when a swap completion is sent from the GPU process. |
| 64 // The argument |params_mac| is used to communicate parameters needed on Mac |
| 65 // to display the CALayer for the swap in the browser process. |
| 66 // TODO(ccameron): Remove |params_mac| when the CALayer tree is hosted in the |
| 67 // browser process. |
| 60 virtual void OnGpuSwapBuffersCompleted( | 68 virtual void OnGpuSwapBuffersCompleted( |
| 61 const std::vector<ui::LatencyInfo>& latency_info, | 69 const std::vector<ui::LatencyInfo>& latency_info, |
| 62 gfx::SwapResult result) = 0; | 70 gfx::SwapResult result, |
| 71 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) = 0; |
| 63 | 72 |
| 64 #if defined(OS_MACOSX) | 73 #if defined(OS_MACOSX) |
| 65 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0; | 74 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0; |
| 66 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const = 0; | 75 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const = 0; |
| 67 #endif | 76 #endif |
| 68 | 77 |
| 69 protected: | 78 protected: |
| 70 // Constructor used by the accelerated implementation. | 79 // Constructor used by the accelerated implementation. |
| 71 BrowserCompositorOutputSurface( | 80 BrowserCompositorOutputSurface( |
| 72 const scoped_refptr<cc::ContextProvider>& context, | 81 const scoped_refptr<cc::ContextProvider>& context, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 103 | 112 |
| 104 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 113 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
| 105 overlay_candidate_validator_; | 114 overlay_candidate_validator_; |
| 106 | 115 |
| 107 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); | 116 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); |
| 108 }; | 117 }; |
| 109 | 118 |
| 110 } // namespace content | 119 } // namespace content |
| 111 | 120 |
| 112 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 121 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
| OLD | NEW |