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

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

Issue 2690583002: Make cc/paint have concrete types (Closed)
Patch Set: PaintRecord as typedef, fixup playback calls 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 72474a405f2dd510f2679bf1ea95c4cbc1086383..3118cad3ee25f2974ce1387b3dd3e130024561ed 100644
--- a/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
+++ b/third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
@@ -31,6 +31,7 @@
#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 {
@@ -47,24 +48,25 @@ UnacceleratedImageBufferSurface::UnacceleratedImageBufferSurface(
SkImageInfo info = SkImageInfo::Make(size.width(), size.height(), colorType,
alphaType, colorSpace);
SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry);
- m_surface = PaintSurface::MakeRaster(
- info, Opaque == opacityMode ? 0 : &disableLCDProps);
+ m_surface =
+ SkSurface::MakeRaster(info, Opaque == opacityMode ? 0 : &disableLCDProps);
+
+ if (!m_surface)
+ return;
// Always save an initial frame, to support resetting the top level matrix
// and clip.
- if (m_surface)
- m_surface->getCanvas()->save();
+ m_canvas = WTF::wrapUnique(new PaintCanvas(m_surface->getCanvas()));
+ m_canvas->save();
- if (initializationMode == InitializeImagePixels) {
- if (m_surface)
- clear();
- }
+ if (initializationMode == InitializeImagePixels)
+ clear();
}
UnacceleratedImageBufferSurface::~UnacceleratedImageBufferSurface() {}
PaintCanvas* UnacceleratedImageBufferSurface::canvas() {
- return m_surface->getCanvas();
+ return m_canvas.get();
}
bool UnacceleratedImageBufferSurface::isValid() const {

Powered by Google App Engine
This is Rietveld 408576698