| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ | 5 #ifndef CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ |
| 6 #define CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ | 6 #define CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <unordered_set> | 9 #include <unordered_set> |
| 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 13 #include "cc/output/compositor_frame.h" | 14 #include "cc/output/compositor_frame.h" |
| 14 #include "cc/scheduler/begin_frame_source.h" | 15 #include "cc/scheduler/begin_frame_source.h" |
| 15 #include "cc/surfaces/referenced_surface_tracker.h" | 16 #include "cc/surfaces/referenced_surface_tracker.h" |
| 16 #include "cc/surfaces/surface_factory.h" | 17 #include "cc/surfaces/surface_factory.h" |
| 17 #include "cc/surfaces/surface_factory_client.h" | 18 #include "cc/surfaces/surface_factory_client.h" |
| 18 #include "cc/surfaces/surface_id.h" | 19 #include "cc/surfaces/surface_id.h" |
| 19 #include "cc/surfaces/surfaces_export.h" | 20 #include "cc/surfaces/surfaces_export.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 45 const ReferencedSurfaceTracker& ReferenceTrackerForTesting() const { | 46 const ReferencedSurfaceTracker& ReferenceTrackerForTesting() const { |
| 46 return reference_tracker_; | 47 return reference_tracker_; |
| 47 } | 48 } |
| 48 | 49 |
| 49 void EvictFrame(); | 50 void EvictFrame(); |
| 50 void SetNeedsBeginFrame(bool needs_begin_frame); | 51 void SetNeedsBeginFrame(bool needs_begin_frame); |
| 51 void SubmitCompositorFrame(const LocalSurfaceId& local_surface_id, | 52 void SubmitCompositorFrame(const LocalSurfaceId& local_surface_id, |
| 52 CompositorFrame frame); | 53 CompositorFrame frame); |
| 53 void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> request); | 54 void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> request); |
| 54 void ForceReclaimResources(); | 55 void ForceReclaimResources(); |
| 56 void ClaimTemporaryReference(const SurfaceId& surface_id); |
| 55 | 57 |
| 56 private: | 58 private: |
| 57 // Update surface references with SurfaceManager for current CompositorFrame | 59 // Update surface references with SurfaceManager for current CompositorFrame |
| 58 // that has |local_surface_id|. UpdateReferences() must be called on | 60 // that has |local_surface_id|. UpdateReferences() must be called on |
| 59 // |reference_tracker_| before calling this. Will add and remove top-level | 61 // |reference_tracker_| before calling this. Will add and remove top-level |
| 60 // root references if |display_| is not null. | 62 // root references if |display_| is not null. |
| 61 void UpdateSurfaceReferences(const SurfaceId& last_surface_id, | 63 void UpdateSurfaceReferences(const SurfaceId& last_surface_id, |
| 62 const LocalSurfaceId& local_surface_id); | 64 const LocalSurfaceId& local_surface_id); |
| 63 | 65 |
| 64 void AddTopLevelRootReference(const SurfaceId& surface_id); | 66 void AddTopLevelRootReference(const SurfaceId& surface_id); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 const bool handles_frame_sink_id_invalidation_; | 128 const bool handles_frame_sink_id_invalidation_; |
| 127 | 129 |
| 128 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_; | 130 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_; |
| 129 | 131 |
| 130 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport); | 132 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport); |
| 131 }; | 133 }; |
| 132 | 134 |
| 133 } // namespace cc | 135 } // namespace cc |
| 134 | 136 |
| 135 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ | 137 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ |
| OLD | NEW |