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

Unified Diff: Source/platform/graphics/ImageBufferSurface.h

Issue 104023007: Refactoring ImageBuffer to decouple it from Canvas2DLayerBridge (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: build fixes for win+mac Created 7 years 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
Index: Source/platform/graphics/ImageBufferSurface.h
diff --git a/Source/core/rendering/LayoutRectRecorder.h b/Source/platform/graphics/ImageBufferSurface.h
similarity index 55%
copy from Source/core/rendering/LayoutRectRecorder.h
copy to Source/platform/graphics/ImageBufferSurface.h
index 9fd331e2aca95cb262bbbd4e738d3b78286caa2d..ffc0edf407783eebf3982dd1f6bc3ebf28c5bea1 100644
--- a/Source/core/rendering/LayoutRectRecorder.h
+++ b/Source/platform/graphics/ImageBufferSurface.h
@@ -28,32 +28,58 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LayoutRectRecorder_h
-#define LayoutRectRecorder_h
+#ifndef ImageBufferSurface_h
+#define ImageBufferSurface_h
-#include "platform/geometry/LayoutRect.h"
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/GraphicsTypes3D.h"
+#include "wtf/FastAllocBase.h"
#include "wtf/Noncopyable.h"
+class SkCanvas;
+class SkBitmap;
+
+namespace blink { class WebLayer; }
+
namespace WebCore {
-class RenderLayerModelObject;
-class RenderObject;
+enum OpacityMode {
+ NonOpaque,
+ Opaque,
+};
-class LayoutRectRecorder {
- WTF_MAKE_NONCOPYABLE(LayoutRectRecorder);
+class ImageBufferSurface {
+ WTF_MAKE_NONCOPYABLE(ImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
public:
- LayoutRectRecorder(RenderObject&, bool skipRecording = false);
- ~LayoutRectRecorder();
+ virtual ~ImageBufferSurface() { }
+
+ virtual SkCanvas* canvas() const = 0;
+ virtual const SkBitmap& bitmap() const;
+ virtual void aboutToUse() { } // Called by ImageBuffer before reading or writing to the surface.
+ virtual bool isValid() const = 0;
+ virtual blink::WebLayer* layer() const { return 0; };
+ virtual bool isAccelerated() const { return false; }
+ virtual Platform3DObject getBackingTexture() const { return 0; }
- static bool shouldRecordLayoutRects();
+ float resolutionScale() const { return m_resolutionScale; }
+ OpacityMode opacityMode() const { return m_opacityMode; }
+ const IntSize& size() const { return m_size; }
+
+protected:
+ void clear();
+
+ ImageBufferSurface(const IntSize& size, OpacityMode opacityMode, float resolutionScale)
+ : m_opacityMode(opacityMode)
+ , m_resolutionScale(resolutionScale)
+ , m_size(size)
+ { }
private:
- RenderObject& m_object;
- RenderLayerModelObject* m_repaintContainer;
- unsigned m_skipRecording : 1;
+ OpacityMode m_opacityMode;
+ float m_resolutionScale;
+ IntSize m_size;
};
} // namespace WebCore
-#endif // LayoutRectRecorder_h
-
+#endif

Powered by Google App Engine
This is Rietveld 408576698