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

Side by Side Diff: content/browser/renderer_host/delegated_frame_host.h

Issue 2702093002: Consistent CopyFromSurface() API, consolidated to RWHV (Closed)
Patch Set: REBASE Created 3 years, 9 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
OLDNEW
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_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // DelegatedFrameEvictorClient implementation. 114 // DelegatedFrameEvictorClient implementation.
115 void EvictDelegatedFrame() override; 115 void EvictDelegatedFrame() override;
116 116
117 // cc::CompositorFrameSinkSupportClient implementation. 117 // cc::CompositorFrameSinkSupportClient implementation.
118 void DidReceiveCompositorFrameAck() override; 118 void DidReceiveCompositorFrameAck() override;
119 void OnBeginFrame(const cc::BeginFrameArgs& args) override; 119 void OnBeginFrame(const cc::BeginFrameArgs& args) override;
120 void ReclaimResources(const cc::ReturnedResourceArray& resources) override; 120 void ReclaimResources(const cc::ReturnedResourceArray& resources) override;
121 void WillDrawSurface(const cc::LocalSurfaceId& id, 121 void WillDrawSurface(const cc::LocalSurfaceId& id,
122 const gfx::Rect& damage_rect) override; 122 const gfx::Rect& damage_rect) override;
123 123
124 bool CanCopyToBitmap() const;
125
126 // Public interface exposed to RenderWidgetHostView. 124 // Public interface exposed to RenderWidgetHostView.
127 125
128 void SwapDelegatedFrame(uint32_t compositor_frame_sink_id, 126 void SwapDelegatedFrame(uint32_t compositor_frame_sink_id,
129 cc::CompositorFrame frame); 127 cc::CompositorFrame frame);
130 void ClearDelegatedFrame(); 128 void ClearDelegatedFrame();
131 void WasHidden(); 129 void WasHidden();
132 void WasShown(const ui::LatencyInfo& latency_info); 130 void WasShown(const ui::LatencyInfo& latency_info);
133 void WasResized(); 131 void WasResized();
134 bool HasSavedFrame(); 132 bool HasSavedFrame();
135 gfx::Size GetRequestedRendererSize() const; 133 gfx::Size GetRequestedRendererSize() const;
136 void SetCompositor(ui::Compositor* compositor); 134 void SetCompositor(ui::Compositor* compositor);
137 void ResetCompositor(); 135 void ResetCompositor();
138 // Note: |src_subset| is specified in DIP dimensions while |output_size| 136 // Note: |src_subrect| is specified in DIP dimensions while |output_size|
139 // expects pixels. 137 // expects pixels. If |src_subrect| is empty, the entire surface area is
138 // copied.
140 void CopyFromCompositingSurface(const gfx::Rect& src_subrect, 139 void CopyFromCompositingSurface(const gfx::Rect& src_subrect,
141 const gfx::Size& output_size, 140 const gfx::Size& output_size,
142 const ReadbackRequestCallback& callback, 141 const ReadbackRequestCallback& callback,
143 const SkColorType preferred_color_type); 142 const SkColorType preferred_color_type);
144 void CopyFromCompositingSurfaceToVideoFrame( 143 void CopyFromCompositingSurfaceToVideoFrame(
145 const gfx::Rect& src_subrect, 144 const gfx::Rect& src_subrect,
146 const scoped_refptr<media::VideoFrame>& target, 145 scoped_refptr<media::VideoFrame> target,
147 const base::Callback<void(const gfx::Rect&, bool)>& callback); 146 const base::Callback<void(const gfx::Rect&, bool)>& callback);
148 bool CanCopyToVideoFrame() const; 147 bool CanCopyFromCompositingSurface() const;
149 void BeginFrameSubscription( 148 void BeginFrameSubscription(
150 std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber); 149 std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber);
151 void EndFrameSubscription(); 150 void EndFrameSubscription();
152 bool HasFrameSubscriber() const { return !!frame_subscriber_; } 151 bool HasFrameSubscriber() const { return !!frame_subscriber_; }
153 cc::FrameSinkId GetFrameSinkId(); 152 cc::FrameSinkId GetFrameSinkId();
154 // Returns a null SurfaceId if this DelegatedFrameHost has not yet created 153 // Returns a null SurfaceId if this DelegatedFrameHost has not yet created
155 // a compositor Surface. 154 // a compositor Surface.
156 cc::SurfaceId SurfaceIdAtPoint(cc::SurfaceHittestDelegate* delegate, 155 cc::SurfaceId SurfaceIdAtPoint(cc::SurfaceHittestDelegate* delegate,
157 const gfx::Point& point, 156 const gfx::Point& point,
158 gfx::Point* transformed_point); 157 gfx::Point* transformed_point);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_; 338 std::unique_ptr<cc::ExternalBeginFrameSource> begin_frame_source_;
340 339
341 bool needs_begin_frame_ = false; 340 bool needs_begin_frame_ = false;
342 341
343 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; 342 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_;
344 }; 343 };
345 344
346 } // namespace content 345 } // namespace content
347 346
348 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ 347 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/browser_compositor_view_mac.mm ('k') | content/browser/renderer_host/delegated_frame_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698