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 SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_H_ | 5 #ifndef SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_H_ |
6 #define SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_H_ | 6 #define SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // swaps to an actual GL surface. | 22 // swaps to an actual GL surface. |
23 class DirectOutputSurface : public cc::OutputSurface, | 23 class DirectOutputSurface : public cc::OutputSurface, |
24 public SurfacesContextProviderDelegate { | 24 public SurfacesContextProviderDelegate { |
25 public: | 25 public: |
26 explicit DirectOutputSurface( | 26 explicit DirectOutputSurface( |
27 scoped_refptr<SurfacesContextProvider> context_provider, | 27 scoped_refptr<SurfacesContextProvider> context_provider, |
28 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source); | 28 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source); |
29 ~DirectOutputSurface() override; | 29 ~DirectOutputSurface() override; |
30 | 30 |
31 // cc::OutputSurface implementation | 31 // cc::OutputSurface implementation |
32 bool BindToClient(cc::OutputSurfaceClient* client) override; | 32 void BindToClient(cc::OutputSurfaceClient* client) override; |
33 void EnsureBackbuffer() override; | 33 void EnsureBackbuffer() override; |
34 void DiscardBackbuffer() override; | 34 void DiscardBackbuffer() override; |
35 void BindFramebuffer() override; | 35 void BindFramebuffer() override; |
36 void Reshape(const gfx::Size& size, | 36 void Reshape(const gfx::Size& size, |
37 float device_scale_factor, | 37 float device_scale_factor, |
38 const gfx::ColorSpace& color_space, | 38 const gfx::ColorSpace& color_space, |
39 bool has_alpha) override; | 39 bool has_alpha) override; |
40 void SwapBuffers(cc::OutputSurfaceFrame frame) override; | 40 void SwapBuffers(cc::OutputSurfaceFrame frame) override; |
41 uint32_t GetFramebufferCopyTextureFormat() override; | 41 uint32_t GetFramebufferCopyTextureFormat() override; |
42 cc::OverlayCandidateValidator* GetOverlayCandidateValidator() const override; | 42 cc::OverlayCandidateValidator* GetOverlayCandidateValidator() const override; |
43 bool IsDisplayedAsOverlayPlane() const override; | 43 bool IsDisplayedAsOverlayPlane() const override; |
44 unsigned GetOverlayTextureId() const override; | 44 unsigned GetOverlayTextureId() const override; |
45 bool SurfaceIsSuspendForRecycle() const override; | 45 bool SurfaceIsSuspendForRecycle() const override; |
46 bool HasExternalStencilTest() const override; | 46 bool HasExternalStencilTest() const override; |
47 void ApplyExternalStencil() override; | 47 void ApplyExternalStencil() override; |
48 | 48 |
49 // SurfacesContextProviderDelegate implementation | 49 // SurfacesContextProviderDelegate implementation |
50 void OnVSyncParametersUpdated(const base::TimeTicks& timebase, | 50 void OnVSyncParametersUpdated(const base::TimeTicks& timebase, |
51 const base::TimeDelta& interval) override; | 51 const base::TimeDelta& interval) override; |
52 | 52 |
53 private: | 53 private: |
54 void OnSwapBuffersComplete(); | 54 void OnSwapBuffersComplete(); |
55 | 55 |
| 56 cc::OutputSurfaceClient* client_ = nullptr; |
56 cc::SyntheticBeginFrameSource* const synthetic_begin_frame_source_; | 57 cc::SyntheticBeginFrameSource* const synthetic_begin_frame_source_; |
57 base::WeakPtrFactory<DirectOutputSurface> weak_ptr_factory_; | 58 base::WeakPtrFactory<DirectOutputSurface> weak_ptr_factory_; |
58 }; | 59 }; |
59 | 60 |
60 } // namespace ui | 61 } // namespace ui |
61 | 62 |
62 #endif // SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_H_ | 63 #endif // SERVICES_UI_SURFACES_DIRECT_OUTPUT_SURFACE_H_ |
OLD | NEW |