Begin kLegacyFontHost_InitType cleanup
This CL starts the process of pushing kLegacyFontHost_InitType-type SkSurfaceProps up the call stack and out of Skia. It:
Gets rid of the default SkBaseDevice ctor. This means everyone has to always hand an explicit SkSurfaceProps to it.
It makes public the SkBitmapDevice creation methods that require SkSurfaceProps.
Removes (in Skia's code base) all SkBitmapDevice ctor calls w/o SkSurfaceProps.
Makes the "recording" canvases (e.g., pdf, svg, xps) explicitly not use kLegacyFontHost_InitType.
Replicates the creating canvas/device's flags on saveLayer devices
BUG=skia:3934
Review URL: https://codereview.chromium.org/1204433002
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index 4c9b270..dd22cf95 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -8,9 +8,9 @@
#include "SkDeferredCanvas.h"
-#include "SkBitmapDevice.h"
#include "SkChunkAlloc.h"
#include "SkColorFilter.h"
+#include "SkDevice.h"
#include "SkDrawFilter.h"
#include "SkGPipe.h"
#include "SkImage_Base.h"
@@ -283,9 +283,12 @@
bool fIsDrawingToLayer;
size_t fMaxRecordingStorageBytes;
size_t fPreviousStorageAllocated;
+
+ typedef SkBaseDevice INHERITED;
};
-SkDeferredDevice::SkDeferredDevice(SkSurface* surface) {
+SkDeferredDevice::SkDeferredDevice(SkSurface* surface)
+ : INHERITED(surface->props()) {
fMaxRecordingStorageBytes = kDefaultMaxRecordingStorageBytes;
fNotificationClient = NULL;
fImmediateCanvas = NULL;
@@ -537,6 +540,10 @@
};
SkDeferredCanvas* SkDeferredCanvas::Create(SkSurface* surface) {
+ if (!surface) {
+ return NULL;
+ }
+
SkAutoTUnref<SkDeferredDevice> deferredDevice(SkNEW_ARGS(SkDeferredDevice, (surface)));
return SkNEW_ARGS(SkDeferredCanvas, (deferredDevice));
}