diff options
Diffstat (limited to 'chromium/content/browser/compositor/delegated_frame_host.h')
-rw-r--r-- | chromium/content/browser/compositor/delegated_frame_host.h | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/chromium/content/browser/compositor/delegated_frame_host.h b/chromium/content/browser/compositor/delegated_frame_host.h index aa3ce5b1d38..21dc4e0c8f9 100644 --- a/chromium/content/browser/compositor/delegated_frame_host.h +++ b/chromium/content/browser/compositor/delegated_frame_host.h @@ -5,6 +5,10 @@ #ifndef CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ #define CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ +#include <stdint.h> + +#include <vector> + #include "base/gtest_prod_util.h" #include "cc/layers/delegated_frame_provider.h" #include "cc/layers/delegated_frame_resource_collection.h" @@ -22,6 +26,7 @@ #include "ui/compositor/compositor_vsync_manager.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_owner_delegate.h" +#include "ui/events/event.h" #include "ui/gfx/geometry/rect_conversions.h" namespace base { @@ -116,18 +121,16 @@ class CONTENT_EXPORT DelegatedFrameHost // cc::SurfaceFactoryClient implementation. void ReturnResources(const cc::ReturnedResourceArray& resources) override; + void WillDrawSurface(cc::SurfaceId id, const gfx::Rect& damage_rect) override; + void SetBeginFrameSource(cc::SurfaceId surface_id, + cc::BeginFrameSource* begin_frame_source) override; bool CanCopyToBitmap() const; // Public interface exposed to RenderWidgetHostView. - // Note: |satisfies_sequences| is cleared in calls to this function. - void SwapDelegatedFrame( - uint32 output_surface_id, - scoped_ptr<cc::DelegatedFrameData> frame_data, - float frame_device_scale_factor, - const std::vector<ui::LatencyInfo>& latency_info, - std::vector<uint32_t>* satisfies_sequences); + void SwapDelegatedFrame(uint32_t output_surface_id, + scoped_ptr<cc::CompositorFrame> frame); void ClearDelegatedFrame(); void WasHidden(); void WasShown(const ui::LatencyInfo& latency_info); @@ -147,7 +150,7 @@ class CONTENT_EXPORT DelegatedFrameHost void CopyFromCompositingSurfaceToVideoFrame( const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, - const base::Callback<void(bool)>& callback); + const base::Callback<void(const gfx::Rect&, bool)>& callback); bool CanCopyToVideoFrame() const; void BeginFrameSubscription( scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber); @@ -159,6 +162,14 @@ class CONTENT_EXPORT DelegatedFrameHost cc::SurfaceId SurfaceIdAtPoint(const gfx::Point& point, gfx::Point* transformed_point); + // Given the SurfaceID of a Surface that is contained within this class' + // Surface, find the relative transform between the Surfaces and apply it + // to a point. If a Surface has not yet been created this returns the + // same point with no transform applied. + void TransformPointToLocalCoordSpace(const gfx::Point& point, + cc::SurfaceId original_surface, + gfx::Point* transformed_point); + // Exposed for tests. cc::DelegatedFrameProvider* FrameProviderForTesting() const { return frame_provider_.get(); @@ -227,7 +238,7 @@ class CONTENT_EXPORT DelegatedFrameHost base::WeakPtr<DelegatedFrameHost> rwhva, scoped_refptr<OwnedMailbox> subscriber_texture, scoped_refptr<media::VideoFrame> video_frame, - const base::Callback<void(bool)>& callback, + const base::Callback<void(const gfx::Rect&, bool)>& callback, scoped_ptr<cc::CopyOutputResult> result); static void CopyFromCompositingSurfaceFinishedForVideo( base::WeakPtr<DelegatedFrameHost> rwhva, @@ -238,15 +249,15 @@ class CONTENT_EXPORT DelegatedFrameHost static void ReturnSubscriberTexture( base::WeakPtr<DelegatedFrameHost> rwhva, scoped_refptr<OwnedMailbox> subscriber_texture, - uint32 sync_point); + const gpu::SyncToken& sync_token); - void SendDelegatedFrameAck(uint32 output_surface_id); - void SurfaceDrawn(uint32 output_surface_id, cc::SurfaceDrawStatus drawn); - void SendReturnedDelegatedResources(uint32 output_surface_id); + void SendDelegatedFrameAck(uint32_t output_surface_id); + void SurfaceDrawn(uint32_t output_surface_id, cc::SurfaceDrawStatus drawn); + void SendReturnedDelegatedResources(uint32_t output_surface_id); // Called to consult the current |frame_subscriber_|, to determine and maybe // initiate a copy-into-video-frame request. - void DidReceiveFrameFromRenderer(const gfx::Rect& damage_rect); + void AttemptFrameSubscriberCapture(const gfx::Rect& damage_rect); DelegatedFrameHostClient* const client_; ui::Compositor* compositor_; @@ -271,7 +282,7 @@ class CONTENT_EXPORT DelegatedFrameHost // With delegated renderer, this is the last output surface, used to // disambiguate resources with the same id coming from different output // surfaces. - uint32 last_output_surface_id_; + uint32_t last_output_surface_id_; // The number of delegated frame acks that are pending, to delay resource // returns until the acks are sent. |