Loading image/ISurfaceProvider.h +22 −13 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ namespace mozilla { namespace image { class CachedSurface; /** * An interface for objects which can either store a surface or dynamically * generate one. Loading @@ -41,13 +43,6 @@ public: /// @return true if DrawableRef() will return a completely decoded surface. virtual bool IsFinished() const = 0; /// @return true if this ISurfaceProvider is locked. (@see SetLocked()) virtual bool IsLocked() const = 0; /// If @aLocked is true, hint that this ISurfaceProvider is in use and it /// should avoid releasing its resources. virtual void SetLocked(bool aLocked) = 0; /// @return the number of bytes of memory this ISurfaceProvider is expected to /// require. Optimizations may result in lower real memory usage. Trivial /// overhead is ignored. Loading @@ -67,7 +62,19 @@ protected: virtual ~ISurfaceProvider() { } /// @return true if this ISurfaceProvider is locked. (@see SetLocked()) /// Should only be called from SurfaceCache code as it relies on SurfaceCache /// for synchronization. virtual bool IsLocked() const = 0; /// If @aLocked is true, hint that this ISurfaceProvider is in use and it /// should avoid releasing its resources. Should only be called from /// SurfaceCache code as it relies on SurfaceCache for synchronization. virtual void SetLocked(bool aLocked) = 0; private: friend class CachedSurface; AvailabilityState mAvailability; }; Loading @@ -86,6 +93,14 @@ public: DrawableFrameRef DrawableRef() override { return mSurface->DrawableRef(); } bool IsFinished() const override { return mSurface->IsFinished(); } size_t LogicalSizeInBytes() const override { gfx::IntSize size = mSurface->GetSize(); return size.width * size.height * mSurface->GetBytesPerPixel(); } protected: bool IsLocked() const override { return bool(mLockRef); } void SetLocked(bool aLocked) override Loading @@ -100,12 +115,6 @@ public: : DrawableFrameRef(); } size_t LogicalSizeInBytes() const override { gfx::IntSize size = mSurface->GetSize(); return size.width * size.height * mSurface->GetBytesPerPixel(); } private: virtual ~SimpleSurfaceProvider() { } Loading Loading
image/ISurfaceProvider.h +22 −13 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ namespace mozilla { namespace image { class CachedSurface; /** * An interface for objects which can either store a surface or dynamically * generate one. Loading @@ -41,13 +43,6 @@ public: /// @return true if DrawableRef() will return a completely decoded surface. virtual bool IsFinished() const = 0; /// @return true if this ISurfaceProvider is locked. (@see SetLocked()) virtual bool IsLocked() const = 0; /// If @aLocked is true, hint that this ISurfaceProvider is in use and it /// should avoid releasing its resources. virtual void SetLocked(bool aLocked) = 0; /// @return the number of bytes of memory this ISurfaceProvider is expected to /// require. Optimizations may result in lower real memory usage. Trivial /// overhead is ignored. Loading @@ -67,7 +62,19 @@ protected: virtual ~ISurfaceProvider() { } /// @return true if this ISurfaceProvider is locked. (@see SetLocked()) /// Should only be called from SurfaceCache code as it relies on SurfaceCache /// for synchronization. virtual bool IsLocked() const = 0; /// If @aLocked is true, hint that this ISurfaceProvider is in use and it /// should avoid releasing its resources. Should only be called from /// SurfaceCache code as it relies on SurfaceCache for synchronization. virtual void SetLocked(bool aLocked) = 0; private: friend class CachedSurface; AvailabilityState mAvailability; }; Loading @@ -86,6 +93,14 @@ public: DrawableFrameRef DrawableRef() override { return mSurface->DrawableRef(); } bool IsFinished() const override { return mSurface->IsFinished(); } size_t LogicalSizeInBytes() const override { gfx::IntSize size = mSurface->GetSize(); return size.width * size.height * mSurface->GetBytesPerPixel(); } protected: bool IsLocked() const override { return bool(mLockRef); } void SetLocked(bool aLocked) override Loading @@ -100,12 +115,6 @@ public: : DrawableFrameRef(); } size_t LogicalSizeInBytes() const override { gfx::IntSize size = mSurface->GetSize(); return size.width * size.height * mSurface->GetBytesPerPixel(); } private: virtual ~SimpleSurfaceProvider() { } Loading