Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: cc/surfaces/compositor_frame_sink_support.h

Issue 2800833005: Remove SurfaceFactory Occurrences Outside Of cc (Closed)
Patch Set: Cleanup Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/render_widget_host_view_child_frame.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "cc/output/compositor_frame.h" 14 #include "cc/output/compositor_frame.h"
15 #include "cc/scheduler/begin_frame_source.h" 15 #include "cc/scheduler/begin_frame_source.h"
16 #include "cc/surfaces/referenced_surface_tracker.h" 16 #include "cc/surfaces/referenced_surface_tracker.h"
17 #include "cc/surfaces/surface_factory.h" 17 #include "cc/surfaces/surface_factory.h"
18 #include "cc/surfaces/surface_factory_client.h" 18 #include "cc/surfaces/surface_factory_client.h"
19 #include "cc/surfaces/surface_id.h" 19 #include "cc/surfaces/surface_id.h"
20 #include "cc/surfaces/surfaces_export.h" 20 #include "cc/surfaces/surfaces_export.h"
21 21
22 namespace content {
piman 2017/04/10 17:46:10 This is a layering violation... If all you need is
Alex Z. 2017/04/10 19:12:08 Following the discussion on Slack, the implementat
23 class RenderWidgetHostViewChildFrameTest;
24 } // namespace content
25
22 namespace cc { 26 namespace cc {
23 27
24 class CompositorFrameSinkSupportClient; 28 class CompositorFrameSinkSupportClient;
25 class SurfaceManager; 29 class SurfaceManager;
26 30
27 class CC_SURFACES_EXPORT CompositorFrameSinkSupport 31 class CC_SURFACES_EXPORT CompositorFrameSinkSupport
28 : public SurfaceFactoryClient, 32 : public SurfaceFactoryClient,
29 public BeginFrameObserver { 33 public BeginFrameObserver {
30 public: 34 public:
31 CompositorFrameSinkSupport(CompositorFrameSinkSupportClient* client, 35 CompositorFrameSinkSupport(CompositorFrameSinkSupportClient* client,
(...skipping 18 matching lines...) Expand all
50 void EvictFrame(); 54 void EvictFrame();
51 void SetNeedsBeginFrame(bool needs_begin_frame); 55 void SetNeedsBeginFrame(bool needs_begin_frame);
52 void BeginFrameDidNotSwap(const BeginFrameAck& ack); 56 void BeginFrameDidNotSwap(const BeginFrameAck& ack);
53 void SubmitCompositorFrame(const LocalSurfaceId& local_surface_id, 57 void SubmitCompositorFrame(const LocalSurfaceId& local_surface_id,
54 CompositorFrame frame); 58 CompositorFrame frame);
55 void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> request); 59 void RequestCopyOfSurface(std::unique_ptr<CopyOutputRequest> request);
56 void ForceReclaimResources(); 60 void ForceReclaimResources();
57 void ClaimTemporaryReference(const SurfaceId& surface_id); 61 void ClaimTemporaryReference(const SurfaceId& surface_id);
58 62
59 private: 63 private:
64 friend class content::RenderWidgetHostViewChildFrameTest;
65
60 // Update surface references with SurfaceManager for current CompositorFrame 66 // Update surface references with SurfaceManager for current CompositorFrame
61 // that has |local_surface_id|. UpdateReferences() must be called on 67 // that has |local_surface_id|. UpdateReferences() must be called on
62 // |reference_tracker_| before calling this. Will add and remove top-level 68 // |reference_tracker_| before calling this. Will add and remove top-level
63 // root references if |display_| is not null. 69 // root references if |display_| is not null.
64 void UpdateSurfaceReferences(const SurfaceId& last_surface_id, 70 void UpdateSurfaceReferences(const SurfaceId& last_surface_id,
65 const LocalSurfaceId& local_surface_id); 71 const LocalSurfaceId& local_surface_id);
66 72
67 void AddTopLevelRootReference(const SurfaceId& surface_id); 73 void AddTopLevelRootReference(const SurfaceId& surface_id);
68 void RemoveTopLevelRootReference(const SurfaceId& surface_id); 74 void RemoveTopLevelRootReference(const SurfaceId& surface_id);
69 75
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 const bool handles_frame_sink_id_invalidation_; 135 const bool handles_frame_sink_id_invalidation_;
130 136
131 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_; 137 base::WeakPtrFactory<CompositorFrameSinkSupport> weak_factory_;
132 138
133 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport); 139 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSinkSupport);
134 }; 140 };
135 141
136 } // namespace cc 142 } // namespace cc
137 143
138 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_ 144 #endif // CC_SURFACES_COMPOSITOR_FRAME_SINK_SUPPORT_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_widget_host_view_child_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698