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

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

Issue 392383005: Make UnacceleratedBufferSurface use a SkSurface instead of a SkCanvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 months 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
« no previous file with comments | « Source/platform/graphics/UnacceleratedImageBufferSurface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
diff --git a/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp b/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
index 50b12726a236eaf85c8a3787e5d180f9aa048bae..9151c31094bac253c67e2f132f4f7d00f0517c83 100644
--- a/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
+++ b/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
@@ -31,17 +31,29 @@
#include "config.h"
#include "platform/graphics/UnacceleratedImageBufferSurface.h"
-#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkSurface.h"
#include "wtf/PassRefPtr.h"
namespace WebCore {
UnacceleratedImageBufferSurface::UnacceleratedImageBufferSurface(const IntSize& size, OpacityMode opacityMode)
: ImageBufferSurface(size, opacityMode)
- , m_canvas(adoptRef(SkCanvas::NewRasterN32(size.width(), size.height())))
+ , m_surface(adoptRef(SkSurface::NewRasterPMColor(size.width(), size.height())))
{
- if (m_canvas)
+ if (m_surface)
clear();
}
+UnacceleratedImageBufferSurface::~UnacceleratedImageBufferSurface() { }
+
+SkCanvas* UnacceleratedImageBufferSurface::canvas() const
+{
+ return m_surface->getCanvas();
+}
+
+bool UnacceleratedImageBufferSurface::isValid() const
+{
+ return m_surface;
+}
+
} // namespace WebCore
« no previous file with comments | « Source/platform/graphics/UnacceleratedImageBufferSurface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698