| Index: components/exo/surface.h
|
| diff --git a/components/exo/surface.h b/components/exo/surface.h
|
| index 91c904290e83daf3a5193bb5cda448b2ebc49bf0..7f24e03d2125a26b839b57742d0e6a2a4b9e47d2 100644
|
| --- a/components/exo/surface.h
|
| +++ b/components/exo/surface.h
|
| @@ -17,7 +17,10 @@
|
| #include "base/observer_list.h"
|
| #include "cc/resources/transferable_resource.h"
|
| #include "cc/scheduler/begin_frame_source.h"
|
| +#include "cc/surfaces/surface_factory.h"
|
| #include "cc/surfaces/surface_factory_client.h"
|
| +#include "cc/surfaces/surface_id.h"
|
| +#include "components/exo/exo_compositor_frame_sink.h"
|
| #include "third_party/skia/include/core/SkRegion.h"
|
| #include "third_party/skia/include/core/SkXfermode.h"
|
| #include "ui/aura/window.h"
|
| @@ -30,10 +33,6 @@ class TracedValue;
|
| }
|
| }
|
|
|
| -namespace cc {
|
| -class SurfaceFactory;
|
| -}
|
| -
|
| namespace gfx {
|
| class Path;
|
| }
|
| @@ -56,37 +55,6 @@ class PropertyHelper;
|
| // change in the future when better hardware cursor support is added.
|
| using CursorProvider = Pointer;
|
|
|
| -// This class owns the SurfaceFactory and keeps track of references to the
|
| -// contents of Buffers. It's keeped alive by references from
|
| -// release_callbacks_. It's destroyed when its owning Surface is destroyed and
|
| -// the last outstanding release callback is called.
|
| -class SurfaceFactoryOwner : public base::RefCounted<SurfaceFactoryOwner>,
|
| - public cc::SurfaceFactoryClient {
|
| - public:
|
| - SurfaceFactoryOwner();
|
| -
|
| - // Overridden from cc::SurfaceFactoryClient:
|
| - void ReturnResources(const cc::ReturnedResourceArray& resources) override;
|
| - void WillDrawSurface(const cc::LocalFrameId& id,
|
| - const gfx::Rect& damage_rect) override;
|
| - void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
|
| -
|
| - private:
|
| - friend class base::RefCounted<SurfaceFactoryOwner>;
|
| - friend class Surface;
|
| -
|
| - ~SurfaceFactoryOwner() override;
|
| -
|
| - std::map<int,
|
| - std::pair<scoped_refptr<SurfaceFactoryOwner>,
|
| - std::unique_ptr<cc::SingleReleaseCallback>>>
|
| - release_callbacks_;
|
| - cc::FrameSinkId frame_sink_id_;
|
| - std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_;
|
| - std::unique_ptr<cc::SurfaceFactory> surface_factory_;
|
| - Surface* surface_ = nullptr;
|
| -};
|
| -
|
| // This class represents a rectangular area that is displayed on the screen.
|
| // It has a location, size and pixel contents.
|
| class Surface : public ui::ContextFactoryObserver,
|
| @@ -103,7 +71,10 @@ class Surface : public ui::ContextFactoryObserver,
|
|
|
| aura::Window* window() { return window_.get(); }
|
|
|
| - const cc::LocalFrameId& local_frame_id() const { return local_frame_id_; }
|
| + const cc::LocalFrameId& local_frame_id() const {
|
| + return surface_id_.local_frame_id();
|
| + }
|
| +
|
| cc::SurfaceId GetSurfaceId() const;
|
|
|
| // Set a buffer as the content of this surface. A buffer can only be attached
|
| @@ -351,10 +322,7 @@ class Surface : public ui::ContextFactoryObserver,
|
|
|
| cc::SurfaceManager* surface_manager_;
|
|
|
| - scoped_refptr<SurfaceFactoryOwner> factory_owner_;
|
| -
|
| - // The Surface Id currently attached to the window.
|
| - cc::LocalFrameId local_frame_id_;
|
| + scoped_refptr<ExoCompositorFrameSink> compositor_frame_sink_;
|
|
|
| // The next resource id the buffer will be attached to.
|
| int next_resource_id_ = 1;
|
| @@ -422,6 +390,8 @@ class Surface : public ui::ContextFactoryObserver,
|
| // Surface observer list. Surface does not own the observers.
|
| base::ObserverList<SurfaceObserver, true> observers_;
|
|
|
| + cc::SurfaceId surface_id_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(Surface);
|
| };
|
|
|
|
|