| 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_DISPLAY_OUTPUT_SURFACE_H_ | 5 #ifndef SERVICES_UI_SURFACES_DISPLAY_OUTPUT_SURFACE_H_ |
| 6 #define SERVICES_UI_SURFACES_DISPLAY_OUTPUT_SURFACE_H_ | 6 #define SERVICES_UI_SURFACES_DISPLAY_OUTPUT_SURFACE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "cc/output/in_process_context_provider.h" | 10 #include "cc/output/in_process_context_provider.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 bool has_alpha, | 37 bool has_alpha, |
| 38 bool use_stencil) override; | 38 bool use_stencil) override; |
| 39 void SwapBuffers(cc::OutputSurfaceFrame frame) override; | 39 void SwapBuffers(cc::OutputSurfaceFrame frame) override; |
| 40 uint32_t GetFramebufferCopyTextureFormat() override; | 40 uint32_t GetFramebufferCopyTextureFormat() override; |
| 41 cc::OverlayCandidateValidator* GetOverlayCandidateValidator() const override; | 41 cc::OverlayCandidateValidator* GetOverlayCandidateValidator() const override; |
| 42 bool IsDisplayedAsOverlayPlane() const override; | 42 bool IsDisplayedAsOverlayPlane() const override; |
| 43 unsigned GetOverlayTextureId() const override; | 43 unsigned GetOverlayTextureId() const override; |
| 44 bool SurfaceIsSuspendForRecycle() const override; | 44 bool SurfaceIsSuspendForRecycle() const override; |
| 45 bool HasExternalStencilTest() const override; | 45 bool HasExternalStencilTest() const override; |
| 46 void ApplyExternalStencil() override; | 46 void ApplyExternalStencil() override; |
| 47 bool CanPartialDraw(const gfx::Rect& damage) override; |
| 47 | 48 |
| 48 protected: | 49 protected: |
| 49 cc::OutputSurfaceClient* client() const { return client_; } | 50 cc::OutputSurfaceClient* client() const { return client_; } |
| 50 | 51 |
| 51 // Called when a swap completion is signaled from ImageTransportSurface. | 52 // Called when a swap completion is signaled from ImageTransportSurface. |
| 52 virtual void DidReceiveSwapBuffersAck(gfx::SwapResult result); | 53 virtual void DidReceiveSwapBuffersAck(gfx::SwapResult result); |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 // Called when a swap completion is signaled from ImageTransportSurface. | 56 // Called when a swap completion is signaled from ImageTransportSurface. |
| 56 void OnGpuSwapBuffersCompleted( | 57 void OnGpuSwapBuffersCompleted( |
| 57 const std::vector<ui::LatencyInfo>& latency_info, | 58 const std::vector<ui::LatencyInfo>& latency_info, |
| 58 gfx::SwapResult result, | 59 gfx::SwapResult result, |
| 59 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac); | 60 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac); |
| 60 void OnVSyncParametersUpdated(base::TimeTicks timebase, | 61 void OnVSyncParametersUpdated(base::TimeTicks timebase, |
| 61 base::TimeDelta interval); | 62 base::TimeDelta interval); |
| 62 | 63 |
| 63 cc::OutputSurfaceClient* client_ = nullptr; | 64 cc::OutputSurfaceClient* client_ = nullptr; |
| 64 cc::SyntheticBeginFrameSource* const synthetic_begin_frame_source_; | 65 cc::SyntheticBeginFrameSource* const synthetic_begin_frame_source_; |
| 65 bool set_draw_rectangle_for_frame_ = false; | 66 bool set_draw_rectangle_for_frame_ = false; |
| 66 // True if the draw rectangle has been set at all since the last resize. | 67 // True if the draw rectangle has been set at all since the last resize. |
| 67 bool has_set_draw_rectangle_since_last_resize_ = false; | 68 bool has_set_draw_rectangle_since_last_resize_ = false; |
| 68 gfx::Size size_; | 69 gfx::Size size_; |
| 69 | 70 |
| 70 base::WeakPtrFactory<DisplayOutputSurface> weak_ptr_factory_; | 71 base::WeakPtrFactory<DisplayOutputSurface> weak_ptr_factory_; |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 } // namespace ui | 74 } // namespace ui |
| 74 | 75 |
| 75 #endif // SERVICES_UI_SURFACES_DISPLAY_OUTPUT_SURFACE_H_ | 76 #endif // SERVICES_UI_SURFACES_DISPLAY_OUTPUT_SURFACE_H_ |
| OLD | NEW |