| 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 <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/threading/non_thread_safe.h" | 11 #include "base/threading/non_thread_safe.h" |
| 11 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 12 #include "cc/output/output_surface.h" | 13 #include "cc/output/output_surface.h" |
| 13 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 14 #include "ui/compositor/compositor_vsync_manager.h" | 15 #include "ui/compositor/compositor_vsync_manager.h" |
| 15 | 16 |
| 16 namespace cc { | 17 namespace cc { |
| 17 class SoftwareOutputDevice; | 18 class SoftwareOutputDevice; |
| 18 } | 19 } |
| 19 | 20 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0; | 63 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0; |
| 63 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const = 0; | 64 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const = 0; |
| 64 #endif | 65 #endif |
| 65 | 66 |
| 66 protected: | 67 protected: |
| 67 // Constructor used by the accelerated implementation. | 68 // Constructor used by the accelerated implementation. |
| 68 BrowserCompositorOutputSurface( | 69 BrowserCompositorOutputSurface( |
| 69 const scoped_refptr<cc::ContextProvider>& context, | 70 const scoped_refptr<cc::ContextProvider>& context, |
| 70 const scoped_refptr<cc::ContextProvider>& worker_context, | 71 const scoped_refptr<cc::ContextProvider>& worker_context, |
| 71 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 72 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
| 72 scoped_ptr<BrowserCompositorOverlayCandidateValidator> | 73 std::unique_ptr<BrowserCompositorOverlayCandidateValidator> |
| 73 overlay_candidate_validator); | 74 overlay_candidate_validator); |
| 74 | 75 |
| 75 // Constructor used by the software implementation. | 76 // Constructor used by the software implementation. |
| 76 BrowserCompositorOutputSurface( | 77 BrowserCompositorOutputSurface( |
| 77 scoped_ptr<cc::SoftwareOutputDevice> software_device, | 78 std::unique_ptr<cc::SoftwareOutputDevice> software_device, |
| 78 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager); | 79 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager); |
| 79 | 80 |
| 80 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; | 81 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; |
| 81 ReflectorImpl* reflector_; | 82 ReflectorImpl* reflector_; |
| 82 | 83 |
| 83 // True when BeginFrame scheduling is enabled. | 84 // True when BeginFrame scheduling is enabled. |
| 84 bool use_begin_frame_scheduling_; | 85 bool use_begin_frame_scheduling_; |
| 85 | 86 |
| 86 private: | 87 private: |
| 87 void Initialize(); | 88 void Initialize(); |
| 88 | 89 |
| 89 scoped_ptr<BrowserCompositorOverlayCandidateValidator> | 90 std::unique_ptr<BrowserCompositorOverlayCandidateValidator> |
| 90 overlay_candidate_validator_; | 91 overlay_candidate_validator_; |
| 91 | 92 |
| 92 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); | 93 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); |
| 93 }; | 94 }; |
| 94 | 95 |
| 95 } // namespace content | 96 } // namespace content |
| 96 | 97 |
| 97 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 98 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
| OLD | NEW |