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

Unified Diff: content/browser/compositor/delegated_frame_host.h

Issue 864333004: Clean up DelegatedFrameHost's interface to its client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More debugging over trybots, shoot menow Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/compositor/delegated_frame_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/delegated_frame_host.h
diff --git a/content/browser/compositor/delegated_frame_host.h b/content/browser/compositor/delegated_frame_host.h
index 593455b97fb183f9f6372ece5dc6e6d1a239d07e..a2d9171718b1ffa57636e8adcb7da444346d2562 100644
--- a/content/browser/compositor/delegated_frame_host.h
+++ b/content/browser/compositor/delegated_frame_host.h
@@ -44,25 +44,26 @@ class ResizeLock;
// display them.
class CONTENT_EXPORT DelegatedFrameHostClient {
public:
- virtual ui::Layer* GetLayer() = 0;
- virtual RenderWidgetHostImpl* GetHost() = 0;
- virtual bool IsVisible() = 0;
- virtual scoped_ptr<ResizeLock> CreateResizeLock(
+ virtual ui::Layer* DelegatedFrameHostGetLayer() const = 0;
+ virtual bool DelegatedFrameHostIsVisible() const = 0;
+ virtual gfx::Size DelegatedFrameHostDesiredSizeInDIP() const = 0;
+
+ virtual bool DelegatedFrameCanCreateResizeLock() const = 0;
+ virtual scoped_ptr<ResizeLock> DelegatedFrameHostCreateResizeLock(
bool defer_compositor_lock) = 0;
- virtual gfx::Size DesiredFrameSize() = 0;
-
- // TODO(ccameron): It is likely that at least one of these two functions is
- // redundant. Find which one, and delete it.
- virtual float CurrentDeviceScaleFactor() = 0;
- virtual gfx::Size ConvertViewSizeToPixel(const gfx::Size& size) = 0;
-
- // These are to be overridden for testing only.
- // TODO(ccameron): This is convoluted. Make the tests that need to override
- // these functions test DelegatedFrameHost directly (rather than do it
- // through RenderWidgetHostViewAura).
- virtual DelegatedFrameHost* GetDelegatedFrameHost() const = 0;
- virtual bool ShouldCreateResizeLock();
- virtual void RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request);
+ virtual void DelegatedFrameHostResizeLockWasReleased() = 0;
+
+ virtual void DelegatedFrameHostSendCompositorSwapAck(
+ int output_surface_id,
+ const cc::CompositorFrameAck& ack) = 0;
+ virtual void DelegatedFrameHostSendReclaimCompositorResources(
+ int output_surface_id,
+ const cc::CompositorFrameAck& ack) = 0;
+ virtual void DelegatedFrameHostOnLostCompositorResources() = 0;
+
+ virtual void DelegatedFrameHostUpdateVSyncParameters(
+ const base::TimeTicks& timebase,
+ const base::TimeDelta& interval) = 0;
};
// The DelegatedFrameHost is used to host all of the RenderWidgetHostView state
@@ -120,10 +121,13 @@ class CONTENT_EXPORT DelegatedFrameHost
void OnCompositingDidCommitForTesting(ui::Compositor* compositor) {
OnCompositingDidCommit(compositor);
}
- bool ShouldCreateResizeLockForTesting() { return ShouldCreateResizeLock(); }
bool ReleasedFrontLockActiveForTesting() const {
return !!released_front_lock_.get();
}
+ void SetRequestCopyOfOutputCallbackForTesting(
+ const base::Callback<void(scoped_ptr<cc::CopyOutputRequest>)>& callback) {
+ request_copy_of_output_callback_for_testing_ = callback;
+ }
private:
friend class DelegatedFrameHostClient;
@@ -138,10 +142,9 @@ class CONTENT_EXPORT DelegatedFrameHost
return frame_subscriber_.get();
}
bool ShouldCreateResizeLock();
- void RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request);
-
void LockResources();
void UnlockResources();
+ void RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request);
// Overridden from ui::CompositorObserver:
void OnCompositingDidCommit(ui::Compositor* compositor) override;
@@ -226,8 +229,7 @@ class CONTENT_EXPORT DelegatedFrameHost
void DidReceiveFrameFromRenderer(const gfx::Rect& damage_rect);
- DelegatedFrameHostClient* client_;
-
+ DelegatedFrameHostClient* const client_;
ui::Compositor* compositor_;
// True if this renders into a Surface, false if it renders into a delegated
@@ -305,6 +307,11 @@ class CONTENT_EXPORT DelegatedFrameHost
scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_;
std::vector<scoped_refptr<OwnedMailbox> > idle_frame_subscriber_textures_;
+ // Callback used to pass the output request to the layer or to a function
+ // specified by a test.
+ base::Callback<void(scoped_ptr<cc::CopyOutputRequest>)>
+ request_copy_of_output_callback_for_testing_;
+
// YUV readback pipeline.
scoped_ptr<content::ReadbackYUVInterface>
yuv_readback_pipeline_;
« no previous file with comments | « no previous file | content/browser/compositor/delegated_frame_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698