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

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

Issue 104023007: Refactoring ImageBuffer to decouple it from Canvas2DLayerBridge (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase mayhem 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.cpp
diff --git a/Source/core/rendering/LayoutRectRecorder.h b/Source/platform/graphics/ImageBufferSurface.cpp
similarity index 67%
copy from Source/core/rendering/LayoutRectRecorder.h
copy to Source/platform/graphics/ImageBufferSurface.cpp
index c92eb5efc90d50bfbac57653cda3a1c84df4b4b2..c5e22dbdd036ea8fb2057d573de8ed9d25f96f95 100644
--- a/Source/core/rendering/LayoutRectRecorder.h
+++ b/Source/platform/graphics/ImageBufferSurface.cpp
@@ -28,31 +28,33 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LayoutRectRecorder_h
-#define LayoutRectRecorder_h
+#include "config.h"
-#include "platform/geometry/LayoutRect.h"
-#include "wtf/Noncopyable.h"
+#include "platform/graphics/ImageBufferSurface.h"
-namespace WebCore {
-
-class RenderLayerModelObject;
-class RenderObject;
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkDevice.h"
-class LayoutRectRecorder {
- WTF_MAKE_NONCOPYABLE(LayoutRectRecorder);
-public:
- LayoutRectRecorder(RenderObject&, bool skipRecording = false);
- ~LayoutRectRecorder();
+namespace WebCore {
- static bool shouldRecordLayoutRects();
+void ImageBufferSurface::clear()
+{
+ // Clear the background transparent or opaque, as required. It would be nice if this wasn't
+ // required, but the canvas is currently filled with the magic transparency
+ // color. Can we have another way to manage this?
+ if (isValid()) {
+ if (m_opacityMode == Opaque)
+ canvas()->drawARGB(255, 0, 0, 0, SkXfermode::kSrc_Mode);
+ else
+ canvas()->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
+ }
+}
+
+const SkBitmap& ImageBufferSurface::bitmap() const
+{
+ ASSERT(canvas());
+ return canvas()->getTopDevice()->accessBitmap(false);
+}
-private:
- RenderObject& m_object;
- bool m_skipRecording;
-};
} // namespace WebCore
-
-#endif // LayoutRectRecorder_h
-
« no previous file with comments | « Source/platform/graphics/ImageBufferSurface.h ('k') | Source/platform/graphics/UnacceleratedImageBufferSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698