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

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

Issue 2739533003: Revert of Make cc/paint have concrete types (Closed)
Patch Set: Created 3 years, 9 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
Index: third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp b/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
index 3118cad3ee25f2974ce1387b3dd3e130024561ed..72474a405f2dd510f2679bf1ea95c4cbc1086383 100644
--- a/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
+++ b/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
@@ -31,7 +31,6 @@
#include "platform/graphics/UnacceleratedImageBufferSurface.h"
#include "platform/graphics/skia/SkiaUtils.h"
-#include "third_party/skia/include/core/SkSurface.h"
#include "wtf/PassRefPtr.h"
namespace blink {
@@ -48,25 +47,24 @@
SkImageInfo info = SkImageInfo::Make(size.width(), size.height(), colorType,
alphaType, colorSpace);
SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry);
- m_surface =
- SkSurface::MakeRaster(info, Opaque == opacityMode ? 0 : &disableLCDProps);
-
- if (!m_surface)
- return;
+ m_surface = PaintSurface::MakeRaster(
+ info, Opaque == opacityMode ? 0 : &disableLCDProps);
// Always save an initial frame, to support resetting the top level matrix
// and clip.
- m_canvas = WTF::wrapUnique(new PaintCanvas(m_surface->getCanvas()));
- m_canvas->save();
+ if (m_surface)
+ m_surface->getCanvas()->save();
- if (initializationMode == InitializeImagePixels)
- clear();
+ if (initializationMode == InitializeImagePixels) {
+ if (m_surface)
+ clear();
+ }
}
UnacceleratedImageBufferSurface::~UnacceleratedImageBufferSurface() {}
PaintCanvas* UnacceleratedImageBufferSurface::canvas() {
- return m_canvas.get();
+ return m_surface->getCanvas();
}
bool UnacceleratedImageBufferSurface::isValid() const {

Powered by Google App Engine
This is Rietveld 408576698