X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontent%2Fbrowser%2Fcompositor%2Fdelegated_frame_host.h;h=ac9d90ffd5ea5a4d8af3996069370d5b4b6736ff;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=bcbc758ffadaff63f1960d9f630cc887b4a6ce61;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/content/browser/compositor/delegated_frame_host.h b/src/content/browser/compositor/delegated_frame_host.h index bcbc758..ac9d90f 100644 --- a/src/content/browser/compositor/delegated_frame_host.h +++ b/src/content/browser/compositor/delegated_frame_host.h @@ -8,6 +8,7 @@ #include "cc/layers/delegated_frame_provider.h" #include "cc/layers/delegated_frame_resource_collection.h" #include "cc/output/copy_output_result.h" +#include "cc/surfaces/surface_factory_client.h" #include "content/browser/compositor/image_transport_factory.h" #include "content/browser/compositor/owned_mailbox.h" #include "content/browser/renderer_host/delegated_frame_evictor.h" @@ -21,6 +22,10 @@ #include "ui/compositor/layer_owner_delegate.h" #include "ui/gfx/rect_conversions.h" +namespace cc { +class SurfaceFactory; +} + namespace media { class VideoFrame; } @@ -72,6 +77,7 @@ class CONTENT_EXPORT DelegatedFrameHost public ImageTransportFactoryObserver, public DelegatedFrameEvictorClient, public cc::DelegatedFrameResourceCollectionClient, + public cc::SurfaceFactoryClient, public base::SupportsWeakPtr { public: DelegatedFrameHost(DelegatedFrameHostClient* client); @@ -86,16 +92,17 @@ class CONTENT_EXPORT DelegatedFrameHost float frame_device_scale_factor, const std::vector& latency_info); void WasHidden(); - void WasShown(); + void WasShown(const ui::LatencyInfo& latency_info); void WasResized(); + bool HasSavedFrame(); gfx::Size GetRequestedRendererSize() const; void AddedToWindow(); void RemovingFromWindow(); void CopyFromCompositingSurface( const gfx::Rect& src_subrect, - const gfx::Size& dst_size, + const gfx::Size& output_size, const base::Callback& callback, - const SkBitmap::Config config); + const SkColorType color_type); void CopyFromCompositingSurfaceToVideoFrame( const gfx::Rect& src_subrect, const scoped_refptr& target, @@ -105,6 +112,7 @@ class CONTENT_EXPORT DelegatedFrameHost void BeginFrameSubscription( scoped_ptr subscriber); void EndFrameSubscription(); + bool HasFrameSubscriber() const { return frame_subscriber_; } // Exposed for tests. cc::DelegatedFrameProvider* FrameProviderForTesting() const { @@ -114,6 +122,9 @@ class CONTENT_EXPORT DelegatedFrameHost OnCompositingDidCommit(compositor); } bool ShouldCreateResizeLockForTesting() { return ShouldCreateResizeLock(); } + bool ReleasedFrontLockActiveForTesting() const { + return !!released_front_lock_; + } private: friend class DelegatedFrameHostClient; @@ -172,17 +183,17 @@ class CONTENT_EXPORT DelegatedFrameHost // of the copy. static void CopyFromCompositingSurfaceHasResult( const gfx::Size& dst_size_in_pixel, - const SkBitmap::Config config, + const SkColorType color_type, const base::Callback& callback, scoped_ptr result); static void PrepareTextureCopyOutputResult( const gfx::Size& dst_size_in_pixel, - const SkBitmap::Config config, + const SkColorType color_type, const base::Callback& callback, scoped_ptr result); static void PrepareBitmapCopyOutputResult( const gfx::Size& dst_size_in_pixel, - const SkBitmap::Config config, + const SkColorType color_type, const base::Callback& callback, scoped_ptr result); static void CopyFromCompositingSurfaceHasResultForVideo( @@ -211,15 +222,28 @@ class CONTENT_EXPORT DelegatedFrameHost // cc::DelegatedFrameProviderClient implementation. virtual void UnusedResourcesAreAvailable() OVERRIDE; - void DidReceiveFrameFromRenderer(); + // cc::SurfaceFactoryClient implementation. + virtual void ReturnResources( + const cc::ReturnedResourceArray& resources) OVERRIDE; + + void DidReceiveFrameFromRenderer(const gfx::Rect& damage_rect); DelegatedFrameHostClient* client_; + // True if this renders into a Surface, false if it renders into a delegated + // layer. + bool use_surfaces_; + std::vector on_compositing_did_commit_callbacks_; // The vsync manager we are observing for changes, if any. scoped_refptr vsync_manager_; + // The current VSync timebase and interval. These are zero until the first + // call to OnUpdateVSyncParameters(). + base::TimeTicks vsync_timebase_; + base::TimeDelta vsync_interval_; + // With delegated renderer, this is the last output surface, used to // disambiguate resources with the same id coming from different output // surfaces. @@ -242,6 +266,13 @@ class CONTENT_EXPORT DelegatedFrameHost // Provides delegated frame updates to the cc::DelegatedRendererLayer. scoped_refptr frame_provider_; + // State for rendering into a Surface. + scoped_ptr id_allocator_; + scoped_ptr surface_factory_; + cc::SurfaceId surface_id_; + gfx::Size current_surface_size_; + cc::ReturnedResourceArray surface_returned_resources_; + // This lock is the one waiting for a frame of the right size to come back // from the renderer/GPU process. It is set from the moment the aura window // got resized, to the moment we committed the renderer frame of the same