aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBitmapDevice.cpp4
-rw-r--r--src/core/SkCanvas.cpp84
-rw-r--r--src/core/SkDevice.cpp8
-rw-r--r--src/core/SkDeviceProperties.h107
-rw-r--r--src/core/SkPaint.cpp38
-rw-r--r--src/core/SkPictureRecord.cpp2
-rw-r--r--src/core/SkPictureRecord.h2
-rw-r--r--src/core/SkRecorder.h2
-rw-r--r--src/core/SkSurfacePriv.h25
-rwxr-xr-xsrc/gpu/GrDistanceFieldTextContext.cpp9
-rw-r--r--src/gpu/GrLayerHoister.cpp6
-rw-r--r--src/gpu/SkGpuDevice.cpp18
-rw-r--r--src/gpu/SkGpuDevice.h9
-rw-r--r--src/image/SkSurface.cpp105
-rw-r--r--src/image/SkSurface_Base.h7
-rw-r--r--src/image/SkSurface_Gpu.cpp31
-rw-r--r--src/image/SkSurface_Raster.cpp29
-rw-r--r--src/pdf/SkPDFDevice.cpp4
-rw-r--r--src/ports/SkImageDecoder_CG.cpp1
-rw-r--r--src/utils/SkDeferredCanvas.cpp6
20 files changed, 191 insertions, 306 deletions
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index b48432efa0..0d6c4fcd76 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -357,8 +357,8 @@ void SkBitmapDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device,
draw.drawSprite(src, x, y, paint);
}
-SkSurface* SkBitmapDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps& props) {
- return SkSurface::NewRaster(info, &props);
+SkSurface* SkBitmapDevice::newSurface(const SkImageInfo& info) {
+ return SkSurface::NewRaster(info);
}
const void* SkBitmapDevice::peekPixels(SkImageInfo* info, size_t* rowBytes) {
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index dcc7047dbc..6beb26e4ca 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+
#include "SkCanvas.h"
#include "SkCanvasPriv.h"
#include "SkBitmapDevice.h"
@@ -66,19 +67,6 @@ void SkCanvas::predrawNotify() {
///////////////////////////////////////////////////////////////////////////////
-static uint32_t filter_paint_flags(const SkSurfaceProps& props, uint32_t flags) {
- const uint32_t propFlags = props.flags();
- if (propFlags & SkSurfaceProps::kDisallowDither_Flag) {
- flags &= ~SkPaint::kDither_Flag;
- }
- if (propFlags & SkSurfaceProps::kDisallowAntiAlias_Flag) {
- flags &= ~SkPaint::kAntiAlias_Flag;
- }
- return flags;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
/* This is the record we keep for each SkBaseDevice that the user installs.
The clip/matrix/proc are fields that reflect the top of the save/restore
stack. Whenever the canvas changes, it marks a dirty flag, and then before
@@ -262,12 +250,12 @@ private:
class AutoDrawLooper {
public:
- AutoDrawLooper(SkCanvas* canvas, const SkSurfaceProps& props, const SkPaint& paint,
+ AutoDrawLooper(SkCanvas* canvas, const SkPaint& paint,
bool skipLayerForImageFilter = false,
const SkRect* bounds = NULL) : fOrigPaint(paint) {
fCanvas = canvas;
fFilter = canvas->getDrawFilter();
- fPaint = &fOrigPaint;
+ fPaint = NULL;
fSaveCount = canvas->getSaveCount();
fDoClearImageFilter = false;
fDone = false;
@@ -292,15 +280,6 @@ public:
// can we be marked as simple?
fIsSimple = !fFilter && !fDoClearImageFilter;
}
-
- uint32_t oldFlags = paint.getFlags();
- fNewPaintFlags = filter_paint_flags(props, oldFlags);
- if (fIsSimple && (fNewPaintFlags != oldFlags)) {
- SkPaint* paint = fLazyPaint.set(fOrigPaint);
- paint->setFlags(fNewPaintFlags);
- fPaint = paint;
- // if we're not simple, doNext() will take care of calling setFlags()
- }
}
~AutoDrawLooper() {
@@ -320,6 +299,7 @@ public:
return false;
} else if (fIsSimple) {
fDone = true;
+ fPaint = &fOrigPaint;
return !fPaint->nothingToDraw();
} else {
return this->doNext(drawType);
@@ -333,7 +313,6 @@ private:
SkDrawFilter* fFilter;
const SkPaint* fPaint;
int fSaveCount;
- uint32_t fNewPaintFlags;
bool fDoClearImageFilter;
bool fDone;
bool fIsSimple;
@@ -349,7 +328,6 @@ bool AutoDrawLooper::doNext(SkDrawFilter::Type drawType) {
SkASSERT(fLooperContext || fFilter || fDoClearImageFilter);
SkPaint* paint = fLazyPaint.set(fOrigPaint);
- paint->setFlags(fNewPaintFlags);
if (fDoClearImageFilter) {
paint->setImageFilter(NULL);
@@ -384,17 +362,19 @@ bool AutoDrawLooper::doNext(SkDrawFilter::Type drawType) {
return true;
}
+#include "SkColorPriv.h"
+
////////// macros to place around the internal draw calls //////////////////
#define LOOPER_BEGIN_DRAWDEVICE(paint, type) \
this->predrawNotify(); \
- AutoDrawLooper looper(this, fProps, paint, true); \
+ AutoDrawLooper looper(this, paint, true); \
while (looper.next(type)) { \
SkDrawIter iter(this);
#define LOOPER_BEGIN(paint, type, bounds) \
this->predrawNotify(); \
- AutoDrawLooper looper(this, fProps, paint, false, bounds); \
+ AutoDrawLooper looper(this, paint, false, bounds); \
while (looper.next(type)) { \
SkDrawIter iter(this);
@@ -402,10 +382,6 @@ bool AutoDrawLooper::doNext(SkDrawFilter::Type drawType) {
////////////////////////////////////////////////////////////////////////////
-void SkCanvas::setupDevice(SkBaseDevice* device) {
- device->setPixelGeometry(fProps.pixelGeometry());
-}
-
SkBaseDevice* SkCanvas::init(SkBaseDevice* device, InitFlags flags) {
fConservativeRasterClip = SkToBool(flags & kConservativeRasterClip_InitFlag);
fCachedLocalClipBounds.setEmpty();
@@ -417,6 +393,10 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device, InitFlags flags) {
fCullCount = 0;
fMetaData = NULL;
+ if (device && device->forceConservativeRasterClip()) {
+ fConservativeRasterClip = true;
+ }
+
fMCRec = (MCRec*)fMCStack.push_back();
new (fMCRec) MCRec(fConservativeRasterClip);
@@ -426,10 +406,6 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device, InitFlags flags) {
fSurfaceBase = NULL;
if (device) {
- this->setupDevice(device);
- if (device->forceConservativeRasterClip()) {
- fConservativeRasterClip = true;
- }
device->onAttachToCanvas(this);
fMCRec->fLayer->fDevice = SkRef(device);
fMCRec->fRasterClip.setRect(SkIRect::MakeWH(device->width(), device->height()));
@@ -439,7 +415,6 @@ SkBaseDevice* SkCanvas::init(SkBaseDevice* device, InitFlags flags) {
SkCanvas::SkCanvas()
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
- , fProps(SkSurfaceProps::kLegacyFontHost_InitType)
{
inc_canvas();
@@ -463,7 +438,6 @@ private:
SkCanvas::SkCanvas(int width, int height)
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
- , fProps(SkSurfaceProps::kLegacyFontHost_InitType)
{
inc_canvas();
@@ -472,16 +446,14 @@ SkCanvas::SkCanvas(int width, int height)
SkCanvas::SkCanvas(int width, int height, InitFlags flags)
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
- , fProps(SkSurfaceProps::kLegacyFontHost_InitType)
{
inc_canvas();
this->init(SkNEW_ARGS(SkNoPixelsBitmapDevice, (width, height)), flags)->unref();
}
-SkCanvas::SkCanvas(SkBaseDevice* device, const SkSurfaceProps* props, InitFlags flags)
+SkCanvas::SkCanvas(SkBaseDevice* device, InitFlags flags)
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
- , fProps(SkSurfacePropsCopyOrDefault(props))
{
inc_canvas();
@@ -490,31 +462,18 @@ SkCanvas::SkCanvas(SkBaseDevice* device, const SkSurfaceProps* props, InitFlags
SkCanvas::SkCanvas(SkBaseDevice* device)
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
- , fProps(SkSurfaceProps::kLegacyFontHost_InitType)
{
inc_canvas();
this->init(device, kDefault_InitFlags);
}
-SkCanvas::SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props)
- : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
- , fProps(props)
-{
- inc_canvas();
-
- SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (bitmap)));
- this->init(device, kDefault_InitFlags);
-}
-
SkCanvas::SkCanvas(const SkBitmap& bitmap)
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
- , fProps(SkSurfaceProps::kLegacyFontHost_InitType)
{
inc_canvas();
-
- SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (bitmap)));
- this->init(device, kDefault_InitFlags);
+
+ this->init(SkNEW_ARGS(SkBitmapDevice, (bitmap)), kDefault_InitFlags)->unref();
}
SkCanvas::~SkCanvas() {
@@ -605,7 +564,6 @@ SkBaseDevice* SkCanvas::setRootDevice(SkBaseDevice* device) {
SkRefCnt_SafeAssign(rec->fLayer->fDevice, device);
rootDevice = device;
- this->setupDevice(device);
fDeviceCMDirty = true;
@@ -941,7 +899,6 @@ int SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, Save
SkDebugf("Unable to create device for layer.");
return count;
}
- this->setupDevice(device);
device->setOrigin(ir.fLeft, ir.fTop);
DeviceCM* layer = SkNEW_ARGS(DeviceCM,
@@ -1037,16 +994,13 @@ bool SkCanvas::isDrawingToLayer() const {
return fSaveLayerCount > 0;
}
-SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* props) {
- if (NULL == props) {
- props = &fProps;
- }
- return this->onNewSurface(info, *props);
+SkSurface* SkCanvas::newSurface(const SkImageInfo& info) {
+ return this->onNewSurface(info);
}
-SkSurface* SkCanvas::onNewSurface(const SkImageInfo& info, const SkSurfaceProps& props) {
+SkSurface* SkCanvas::onNewSurface(const SkImageInfo& info) {
SkBaseDevice* dev = this->getDevice();
- return dev ? dev->newSurface(info, props) : NULL;
+ return dev ? dev->newSurface(info) : NULL;
}
SkImageInfo SkCanvas::imageInfo() const {
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 63a7633648..15d0ab6d2c 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -14,7 +14,7 @@
#include "SkTextBlob.h"
SkBaseDevice::SkBaseDevice()
- : fLeakyProperties(SkNEW_ARGS(SkDeviceProperties, (SkDeviceProperties::kLegacyLCD_InitType)))
+ : fLeakyProperties(SkNEW_ARGS(SkDeviceProperties, (SkDeviceProperties::MakeDefault())))
#ifdef SK_DEBUG
, fAttachedToCanvas(false)
#endif
@@ -57,11 +57,7 @@ const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) {
return bitmap;
}
-void SkBaseDevice::setPixelGeometry(SkPixelGeometry geo) {
- fLeakyProperties->fPixelGeometry = geo;
-}
-
-SkSurface* SkBaseDevice::newSurface(const SkImageInfo&, const SkSurfaceProps&) { return NULL; }
+SkSurface* SkBaseDevice::newSurface(const SkImageInfo&) { return NULL; }
const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; }
diff --git a/src/core/SkDeviceProperties.h b/src/core/SkDeviceProperties.h
index 11ecd65157..80e0177650 100644
--- a/src/core/SkDeviceProperties.h
+++ b/src/core/SkDeviceProperties.h
@@ -1,26 +1,103 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
#ifndef SkDeviceProperties_DEFINED
#define SkDeviceProperties_DEFINED
-#include "SkSurfacePriv.h"
+//TODO: get everyone to stop using SkFontLCDConfig::SetSubpixel* and remove this import.
+#include "SkFontLCDConfig.h"
struct SkDeviceProperties {
- enum InitType {
- kLegacyLCD_InitType
+ struct Geometry {
+ /** The orientation of the pixel specifies the interpretation of the
+ * layout. If the orientation is horizontal, the layout is interpreted as
+ * left to right. It the orientation is vertical, the layout is
+ * interpreted top to bottom (rotated 90deg cw from horizontal).
+ */
+ enum Orientation {
+ kUnknown_Orientation = 0x0,
+ kKnown_Orientation = 0x2,
+
+ kHorizontal_Orientation = 0x2, //!< this is the default
+ kVertical_Orientation = 0x3,
+
+ kOrientationMask = 0x3,
+ };
+
+ /** The layout of the pixel specifies its subpixel geometry.
+ *
+ * kUnknown_Layout means that the subpixel elements are not spatially
+ * separated in any known or usable fashion.
+ */
+ enum Layout {
+ kUnknown_Layout = 0x0,
+ kKnown_Layout = 0x8,
+
+ kRGB_Layout = 0x8, //!< this is the default
+ kBGR_Layout = 0xC,
+
+ kLayoutMask = 0xC,
+ };
+
+ Orientation getOrientation() {
+ return static_cast<Orientation>(fGeometry & kOrientationMask);
+ }
+ Layout getLayout() {
+ return static_cast<Layout>(fGeometry & kLayoutMask);
+ }
+
+ bool isOrientationKnown() {
+ return SkToBool(fGeometry & kKnown_Orientation);
+ }
+ bool isLayoutKnown() {
+ return SkToBool(fGeometry & kKnown_Layout);
+ }
+
+ private:
+ //TODO: get everyone to stop using SkFontLCDConfig::SetSubpixel* and replace these calls with constants.
+ static Orientation fromOldOrientation(SkFontLCDConfig::LCDOrientation orientation) {
+ switch (orientation) {
+ case SkFontLCDConfig::kHorizontal_LCDOrientation: return kHorizontal_Orientation;
+ case SkFontLCDConfig::kVertical_LCDOrientation: return kVertical_Orientation;
+ default: return kUnknown_Orientation;
+ }
+ }
+ static Layout fromOldLayout(SkFontLCDConfig::LCDOrder order) {
+ switch (order) {
+ case SkFontLCDConfig::kRGB_LCDOrder: return kRGB_Layout;
+ case SkFontLCDConfig::kBGR_LCDOrder: return kBGR_Layout;
+ default: return kUnknown_Layout;
+ }
+ }
+ public:
+ static Geometry MakeDefault() {
+ Orientation orientation = fromOldOrientation(SkFontLCDConfig::GetSubpixelOrientation()); //kHorizontal_Orientation
+ Layout layout = fromOldLayout(SkFontLCDConfig::GetSubpixelOrder()); //kRGB_Layout
+ Geometry ret = { SkToU8(orientation | layout) };
+ return ret;
+ }
+
+ static Geometry Make(Orientation orientation, Layout layout) {
+ Geometry ret = { SkToU8(orientation | layout) };
+ return ret;
+ }
+
+ uint8_t fGeometry;
};
- SkDeviceProperties(InitType) : fPixelGeometry(SkSurfacePropsDefaultPixelGeometry()) {}
- SkDeviceProperties(SkPixelGeometry geo) : fPixelGeometry(geo) {}
- SkPixelGeometry fPixelGeometry;
+ static SkDeviceProperties MakeDefault() {
+ SkDeviceProperties ret = { Geometry::MakeDefault(), SK_GAMMA_EXPONENT };
+ return ret;
+ }
+
+ static SkDeviceProperties Make(Geometry geometry, SkScalar gamma) {
+ SkDeviceProperties ret = { geometry, gamma };
+ return ret;
+ }
+
+ /** Each pixel of an image will have some number of channels.
+ * Can the layout of those channels be exploited? */
+ Geometry fGeometry;
- // read-only attribute -- until we actually store a value (future CL)
- float getGamma() const { return SK_GAMMA_EXPONENT; }
+ /** Represents the color space of the image. This is a woefully inadequate beginning. */
+ SkScalar fGamma;
};
#endif
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 42144c1029..88bde22704 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1607,33 +1607,19 @@ void SkScalerContext::MakeRec(const SkPaint& paint,
rec->fMaskFormat = SkToU8(computeMaskFormat(paint));
+ SkDeviceProperties::Geometry geometry = deviceProperties
+ ? deviceProperties->fGeometry
+ : SkDeviceProperties::Geometry::MakeDefault();
if (SkMask::kLCD16_Format == rec->fMaskFormat || SkMask::kLCD32_Format == rec->fMaskFormat) {
- if (tooBigForLCD(*rec)) {
+ if (!geometry.isOrientationKnown() || !geometry.isLayoutKnown() || tooBigForLCD(*rec)) {
+ // eeek, can't support LCD
rec->fMaskFormat = SkMask::kA8_Format;
- flags |= SkScalerContext::kGenA8FromLCD_Flag;
} else {
- SkPixelGeometry geometry = deviceProperties
- ? deviceProperties->fPixelGeometry
- : SkSurfacePropsDefaultPixelGeometry();
- switch (geometry) {
- case kUnknown_SkPixelGeometry:
- // eeek, can't support LCD
- rec->fMaskFormat = SkMask::kA8_Format;
- flags |= SkScalerContext::kGenA8FromLCD_Flag;
- break;
- case kRGB_H_SkPixelGeometry:
- // our default, do nothing.
- break;
- case kBGR_H_SkPixelGeometry:
- flags |= SkScalerContext::kLCD_BGROrder_Flag;
- break;
- case kRGB_V_SkPixelGeometry:
- flags |= SkScalerContext::kLCD_Vertical_Flag;
- break;
- case kBGR_V_SkPixelGeometry:
- flags |= SkScalerContext::kLCD_Vertical_Flag;
- flags |= SkScalerContext::kLCD_BGROrder_Flag;
- break;
+ if (SkDeviceProperties::Geometry::kVertical_Orientation == geometry.getOrientation()) {
+ flags |= SkScalerContext::kLCD_Vertical_Flag;
+ }
+ if (SkDeviceProperties::Geometry::kBGR_Layout == geometry.getLayout()) {
+ flags |= SkScalerContext::kLCD_BGROrder_Flag;
}
}
}
@@ -1664,13 +1650,13 @@ void SkScalerContext::MakeRec(const SkPaint& paint,
rec->setDeviceGamma(SK_GAMMA_EXPONENT);
rec->setPaintGamma(SK_GAMMA_EXPONENT);
} else {
- rec->setDeviceGamma(deviceProperties->getGamma());
+ rec->setDeviceGamma(deviceProperties->fGamma);
//For now always set the paint gamma equal to the device gamma.
//The math in SkMaskGamma can handle them being different,
//but it requires superluminous masks when
//Ex : deviceGamma(x) < paintGamma(x) and x is sufficiently large.
- rec->setPaintGamma(deviceProperties->getGamma());
+ rec->setPaintGamma(deviceProperties->fGamma);
}
#ifdef SK_GAMMA_CONTRAST
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 5b28468898..cae8420e95 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -1429,7 +1429,7 @@ void SkPictureRecord::onPopCull() {
///////////////////////////////////////////////////////////////////////////////
-SkSurface* SkPictureRecord::onNewSurface(const SkImageInfo& info, const SkSurfaceProps&) {
+SkSurface* SkPictureRecord::onNewSurface(const SkImageInfo& info) {
return NULL;
}
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index f8895c950e..f2dd87b76a 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -194,7 +194,7 @@ protected:
SkASSERT(fWriter.bytesWritten() == initialOffset + size);
}
- virtual SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE;
+ virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE;
const void* onPeekPixels(SkImageInfo*, size_t*) SK_OVERRIDE {
return NULL;
}
diff --git a/src/core/SkRecorder.h b/src/core/SkRecorder.h
index 9eb68319cb..db57eb0702 100644
--- a/src/core/SkRecorder.h
+++ b/src/core/SkRecorder.h
@@ -115,7 +115,7 @@ public:
void drawData(const void*, size_t) SK_OVERRIDE;
bool isDrawingToLayer() const SK_OVERRIDE;
- SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE { return NULL; }
+ SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE { return NULL; }
private:
template <typename T>
diff --git a/src/core/SkSurfacePriv.h b/src/core/SkSurfacePriv.h
deleted file mode 100644
index 74d19a6df4..0000000000
--- a/src/core/SkSurfacePriv.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkSurfacePriv_DEFINED
-#define SkSurfacePriv_DEFINED
-
-#include "SkSurfaceProps.h"
-
-static inline SkSurfaceProps SkSurfacePropsCopyOrDefault(const SkSurfaceProps* props) {
- if (props) {
- return *props;
- } else {
- return SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType);
- }
-}
-
-static inline SkPixelGeometry SkSurfacePropsDefaultPixelGeometry() {
- return SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType).pixelGeometry();
-}
-
-#endif
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index df07204fcb..313c02ac51 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -131,7 +131,8 @@ void GrDistanceFieldTextContext::setupCoverageEffect(const SkColor& filteredColo
flags |= fUseLCDText ? kUseLCD_DistanceFieldEffectFlag : 0;
flags |= fUseLCDText && fTextMatrix.rectStaysRect() ?
kRectToRect_DistanceFieldEffectFlag : 0;
- bool useBGR = SkPixelGeometryIsBGR(fDeviceProperties.fPixelGeometry);
+ bool useBGR = SkDeviceProperties::Geometry::kBGR_Layout ==
+ fDeviceProperties.fGeometry.getLayout();
flags |= fUseLCDText && useBGR ? kBGR_DistanceFieldEffectFlag : 0;
// see if we need to create a new effect
@@ -148,7 +149,7 @@ void GrDistanceFieldTextContext::setupCoverageEffect(const SkColor& filteredColo
flags));
} else {
#ifdef SK_GAMMA_APPLY_TO_A8
- U8CPU lum = SkColorSpaceLuminance::computeLuminance(fDeviceProperties.getGamma(),
+ U8CPU lum = SkColorSpaceLuminance::computeLuminance(fDeviceProperties.fGamma,
filteredColor);
fCachedEffect.reset(GrDistanceFieldTextureEffect::Create(fCurrTexture,
params,
@@ -501,8 +502,8 @@ static void setup_gamma_texture(GrContext* context, const SkGlyphCache* cache,
#else
SkScalar contrast = 0.5f;
#endif
- SkScalar paintGamma = deviceProperties.getGamma();
- SkScalar deviceGamma = deviceProperties.getGamma();
+ SkScalar paintGamma = deviceProperties.fGamma;
+ SkScalar deviceGamma = deviceProperties.fGamma;
size = SkScalerContext::GetGammaLUTSize(contrast, paintGamma, deviceGamma,
&width, &height);
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index 165716f82d..ba431d33e9 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -142,7 +142,8 @@ void GrLayerHoister::DrawLayers(const SkPicture* picture,
if (atlased.count() > 0) {
// All the atlased layers are rendered into the same GrTexture
SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTargetDirect(
- atlased[0]->texture()->asRenderTarget(), NULL));
+ atlased[0]->texture()->asRenderTarget(),
+ SkSurface::kStandard_TextRenderMode));
SkCanvas* atlasCanvas = surface->getCanvas();
@@ -195,7 +196,8 @@ void GrLayerHoister::DrawLayers(const SkPicture* picture,
// Each non-atlased layer has its own GrTexture
SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTargetDirect(
- layer->texture()->asRenderTarget(), NULL));
+ layer->texture()->asRenderTarget(),
+ SkSurface::kStandard_TextRenderMode));
SkCanvas* layerCanvas = surface->getCanvas();
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 7ce3446b72..02dca83ee0 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -133,15 +133,15 @@ public:
///////////////////////////////////////////////////////////////////////////////
-SkGpuDevice* SkGpuDevice::Create(GrSurface* surface, const SkSurfaceProps& props, unsigned flags) {
+SkGpuDevice* SkGpuDevice::Create(GrSurface* surface, unsigned flags) {
SkASSERT(surface);
if (NULL == surface->asRenderTarget() || surface->wasDestroyed()) {
return NULL;
}
- return SkNEW_ARGS(SkGpuDevice, (surface, props, flags));
+ return SkNEW_ARGS(SkGpuDevice, (surface, flags));
}
-SkGpuDevice::SkGpuDevice(GrSurface* surface, const SkSurfaceProps& props, unsigned flags) {
+SkGpuDevice::SkGpuDevice(GrSurface* surface, unsigned flags) {
fDrawProcs = NULL;
@@ -156,15 +156,13 @@ SkGpuDevice::SkGpuDevice(GrSurface* surface, const SkSurfaceProps& props, unsign
fLegacyBitmap.setInfo(surface->info());
fLegacyBitmap.setPixelRef(pr)->unref();
- this->setPixelGeometry(props.pixelGeometry());
-
bool useDFFonts = !!(flags & kDFFonts_Flag);
fMainTextContext = fContext->createTextContext(fRenderTarget, this->getLeakyProperties(), useDFFonts);
fFallbackTextContext = SkNEW_ARGS(GrBitmapTextContext, (fContext, this->getLeakyProperties()));
}
SkGpuDevice* SkGpuDevice::Create(GrContext* context, const SkImageInfo& origInfo,
- const SkSurfaceProps& props, int sampleCount) {
+ int sampleCount) {
if (kUnknown_SkColorType == origInfo.colorType() ||
origInfo.width() < 0 || origInfo.height() < 0) {
return NULL;
@@ -196,7 +194,7 @@ SkGpuDevice* SkGpuDevice::Create(GrContext* context, const SkImageInfo& origInfo
return NULL;
}
- return SkNEW_ARGS(SkGpuDevice, (texture.get(), props));
+ return SkNEW_ARGS(SkGpuDevice, (texture.get()));
}
SkGpuDevice::~SkGpuDevice() {
@@ -1807,7 +1805,7 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const SkImageInfo& info, Usage usage)
texture.reset(fContext->createUncachedTexture(desc, NULL, 0));
#endif
if (texture.get()) {
- return SkGpuDevice::Create(texture, SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType), flags);
+ return SkGpuDevice::Create(texture, flags);
} else {
GrPrintf("---- failed to create compatible device texture [%d %d]\n",
info.width(), info.height());
@@ -1815,8 +1813,8 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const SkImageInfo& info, Usage usage)
}
}
-SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps& props) {
- return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples(), &props);
+SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info) {
+ return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples());
}
void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) {
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index 41b53b1213..dc59009dae 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -43,7 +43,7 @@ public:
* the kCached_Flag should be specified to make the device responsible for unlocking
* the surface when it is released.
*/
- static SkGpuDevice* Create(GrSurface* surface, const SkSurfaceProps&, unsigned flags = 0);
+ static SkGpuDevice* Create(GrSurface* surface, unsigned flags = 0);
/**
* New device that will create an offscreen renderTarget based on the
@@ -51,8 +51,7 @@ public:
* count against the GrContext's texture cache budget. The device's pixels
* will be uninitialized. On failure, returns NULL.
*/
- static SkGpuDevice* Create(GrContext*, const SkImageInfo&, const SkSurfaceProps&,
- int sampleCount);
+ static SkGpuDevice* Create(GrContext*, const SkImageInfo&, int sampleCount);
virtual ~SkGpuDevice();
@@ -146,11 +145,11 @@ private:
// remove when our clients don't rely on accessBitmap()
SkBitmap fLegacyBitmap;
- SkGpuDevice(GrSurface*, const SkSurfaceProps&, unsigned flags = 0);
+ SkGpuDevice(GrSurface*, unsigned flags = 0);
virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE;
- virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE;
+ virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE;
virtual SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE;
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index 2d0ce7062f..3a28e421a8 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -9,56 +9,14 @@
#include "SkImagePriv.h"
#include "SkCanvas.h"
-#include "SkFontLCDConfig.h"
-static SkPixelGeometry compute_default_geometry() {
- SkFontLCDConfig::LCDOrder order = SkFontLCDConfig::GetSubpixelOrder();
- if (SkFontLCDConfig::kNONE_LCDOrder == order) {
- return kUnknown_SkPixelGeometry;
- } else {
- // Bit0 is RGB(0), BGR(1)
- // Bit1 is H(0), V(1)
- const SkPixelGeometry gGeo[] = {
- kRGB_H_SkPixelGeometry,
- kBGR_H_SkPixelGeometry,
- kRGB_V_SkPixelGeometry,
- kBGR_V_SkPixelGeometry,
- };
- int index = 0;
- if (SkFontLCDConfig::kBGR_LCDOrder == order) {
- index |= 1;
- }
- if (SkFontLCDConfig::kVertical_LCDOrientation == SkFontLCDConfig::GetSubpixelOrientation()){
- index |= 2;
- }
- return gGeo[index];
- }
-}
-
-SkSurfaceProps::SkSurfaceProps() : fFlags(0), fPixelGeometry(kUnknown_SkPixelGeometry) {}
-
-SkSurfaceProps::SkSurfaceProps(InitType) : fFlags(0), fPixelGeometry(compute_default_geometry()) {}
-
-SkSurfaceProps::SkSurfaceProps(uint32_t flags, InitType)
- : fFlags(flags)
- , fPixelGeometry(compute_default_geometry())
-{}
-
-SkSurfaceProps::SkSurfaceProps(uint32_t flags, SkPixelGeometry pg)
- : fFlags(flags), fPixelGeometry(pg)
-{}
-
///////////////////////////////////////////////////////////////////////////////
-SkSurface_Base::SkSurface_Base(int width, int height, const SkSurfaceProps* props)
- : INHERITED(width, height, props)
-{
+SkSurface_Base::SkSurface_Base(int width, int height) : INHERITED(width, height) {
fCachedCanvas = NULL;
fCachedImage = NULL;
}
-SkSurface_Base::SkSurface_Base(const SkImageInfo& info, const SkSurfaceProps* props)
- : INHERITED(info, props)
-{
+SkSurface_Base::SkSurface_Base(const SkImageInfo& info) : INHERITED(info) {
fCachedCanvas = NULL;
fCachedImage = NULL;
}
@@ -73,7 +31,8 @@ SkSurface_Base::~SkSurface_Base() {
SkSafeUnref(fCachedCanvas);
}
-void SkSurface_Base::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) {
+void SkSurface_Base::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y,
+ const SkPaint* paint) {
SkImage* image = this->newImageSnapshot();
if (image) {
image->draw(canvas, x, y, paint);
@@ -115,17 +74,13 @@ static SkSurface_Base* asSB(SkSurface* surface) {
///////////////////////////////////////////////////////////////////////////////
-SkSurface::SkSurface(int width, int height, const SkSurfaceProps* props)
- : fProps(SkSurfacePropsCopyOrDefault(props)), fWidth(width), fHeight(height)
-{
+SkSurface::SkSurface(int width, int height) : fWidth(width), fHeight(height) {
SkASSERT(fWidth >= 0);
SkASSERT(fHeight >= 0);
fGenerationID = 0;
}
-SkSurface::SkSurface(const SkImageInfo& info, const SkSurfaceProps* props)
- : fProps(SkSurfacePropsCopyOrDefault(props)), fWidth(info.width()), fHeight(info.height())
-{
+SkSurface::SkSurface(const SkImageInfo& info) : fWidth(info.width()), fHeight(info.height()) {
SkASSERT(fWidth >= 0);
SkASSERT(fHeight >= 0);
fGenerationID = 0;
@@ -164,51 +119,3 @@ void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y,
const void* SkSurface::peekPixels(SkImageInfo* info, size_t* rowBytes) {
return this->getCanvas()->peekPixels(info, rowBytes);
}
-
-//////////////////////////////////////////////////////////////////////////////////////
-#ifdef SK_SUPPORT_LEGACY_TEXTRENDERMODE
-
-static SkSurfaceProps make_props(SkSurface::TextRenderMode trm) {
- uint32_t propsFlags = 0;
- if (SkSurface::kDistanceField_TextRenderMode == trm) {
- propsFlags |= SkSurfaceProps::kUseDistanceFieldFonts_Flag;
- }
- return SkSurfaceProps(propsFlags, SkSurfaceProps::kLegacyFontHost_InitType);
-}
-
-SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, TextRenderMode trm,
- RenderTargetFlags flags) {
- SkSurfaceProps props = make_props(trm);
- return NewRenderTargetDirect(target, &props, flags);
-}
-
-SkSurface* SkSurface::NewRenderTarget(GrContext* gr, const SkImageInfo& info, int sampleCount,
- TextRenderMode trm, RenderTargetFlags flags) {
- SkSurfaceProps props = make_props(trm);
- return NewRenderTarget(gr, info, sampleCount, &props, flags);
-}
-
-SkSurface* SkSurface::NewScratchRenderTarget(GrContext* gr, const SkImageInfo& info, int sampleCount,
- TextRenderMode trm, RenderTargetFlags flags) {
- SkSurfaceProps props = make_props(trm);
- return NewScratchRenderTarget(gr, info, sampleCount, &props, flags);
-}
-
-#endif
-
-#if !SK_SUPPORT_GPU
-
-SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget*, const SkSurfaceProps*) {
- return NULL;
-}
-
-SkSurface* SkSurface::NewRenderTarget(GrContext*, const SkImageInfo&, int, const SkSurfaceProps*) {
- return NULL;
-}
-
-SkSurface* SkSurface::NewScratchRenderTarget(GrContext*, const SkImageInfo&, int sampleCount,
- const SkSurfaceProps*) {
- return NULL;
-}
-
-#endif
diff --git a/src/image/SkSurface_Base.h b/src/image/SkSurface_Base.h
index 4da4cfb496..e7fa57af0d 100644
--- a/src/image/SkSurface_Base.h
+++ b/src/image/SkSurface_Base.h
@@ -8,14 +8,13 @@
#ifndef SkSurface_Base_DEFINED
#define SkSurface_Base_DEFINED
-#include "SkCanvas.h"
#include "SkSurface.h"
-#include "SkSurfacePriv.h"
+#include "SkCanvas.h"
class SkSurface_Base : public SkSurface {
public:
- SkSurface_Base(int width, int height, const SkSurfaceProps*);
- SkSurface_Base(const SkImageInfo&, const SkSurfaceProps*);
+ SkSurface_Base(int width, int height);
+ explicit SkSurface_Base(const SkImageInfo&);
virtual ~SkSurface_Base();
/**
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 024c151cea..d7260ac29e 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -14,7 +14,7 @@ class SkSurface_Gpu : public SkSurface_Base {
public:
SK_DECLARE_INST_COUNT(SkSurface_Gpu)
- SkSurface_Gpu(GrRenderTarget*, bool cached, const SkSurfaceProps*, bool doClear);
+ SkSurface_Gpu(GrRenderTarget*, bool cached, TextRenderMode trm, bool doClear);
virtual ~SkSurface_Gpu();
virtual SkCanvas* onNewCanvas() SK_OVERRIDE;
@@ -33,14 +33,13 @@ private:
///////////////////////////////////////////////////////////////////////////////
-SkSurface_Gpu::SkSurface_Gpu(GrRenderTarget* renderTarget, bool cached, const SkSurfaceProps* props,
+SkSurface_Gpu::SkSurface_Gpu(GrRenderTarget* renderTarget, bool cached, TextRenderMode trm,
bool doClear)
- : INHERITED(renderTarget->width(), renderTarget->height(), props)
-{
+ : INHERITED(renderTarget->width(), renderTarget->height()) {
int deviceFlags = 0;
deviceFlags |= cached ? SkGpuDevice::kCached_Flag : 0;
- deviceFlags |= this->props().isUseDistanceFieldFonts() ? SkGpuDevice::kDFFonts_Flag : 0;
- fDevice = SkGpuDevice::Create(renderTarget, this->props(), deviceFlags);
+ deviceFlags |= (kDistanceField_TextRenderMode == trm) ? SkGpuDevice::kDFFonts_Flag : 0;
+ fDevice = SkGpuDevice::Create(renderTarget, deviceFlags);
if (kRGB_565_GrPixelConfig != renderTarget->config() && doClear) {
fDevice->clear(0x0);
@@ -52,17 +51,13 @@ SkSurface_Gpu::~SkSurface_Gpu() {
}
SkCanvas* SkSurface_Gpu::onNewCanvas() {
- SkCanvas::InitFlags flags = SkCanvas::kDefault_InitFlags;
- // When we think this works...
-// flags |= SkCanvas::kConservativeRasterClip_InitFlag;
-
- return SkNEW_ARGS(SkCanvas, (fDevice, &this->props(), flags));
+ return SkNEW_ARGS(SkCanvas, (fDevice));
}
SkSurface* SkSurface_Gpu::onNewSurface(const SkImageInfo& info) {
GrRenderTarget* rt = fDevice->accessRenderTarget();
int sampleCount = rt->numSamples();
- return SkSurface::NewRenderTarget(fDevice->context(), info, sampleCount, &this->props());
+ return SkSurface::NewRenderTarget(fDevice->context(), info, sampleCount);
}
SkImage* SkSurface_Gpu::onNewImageSnapshot() {
@@ -107,15 +102,15 @@ void SkSurface_Gpu::onDiscard() {
///////////////////////////////////////////////////////////////////////////////
-SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, const SkSurfaceProps* props) {
+SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, TextRenderMode trm) {
if (NULL == target) {
return NULL;
}
- return SkNEW_ARGS(SkSurface_Gpu, (target, false, props, false));
+ return SkNEW_ARGS(SkSurface_Gpu, (target, false, trm, false));
}
SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, const SkImageInfo& info, int sampleCount,
- const SkSurfaceProps* props) {
+ TextRenderMode trm) {
if (NULL == ctx) {
return NULL;
}
@@ -132,11 +127,11 @@ SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, const SkImageInfo& info, i
return NULL;
}
- return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), false, props, true));
+ return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), false, trm, true));
}
SkSurface* SkSurface::NewScratchRenderTarget(GrContext* ctx, const SkImageInfo& info,
- int sampleCount, const SkSurfaceProps* props) {
+ int sampleCount, TextRenderMode trm) {
if (NULL == ctx) {
return NULL;
}
@@ -154,5 +149,5 @@ SkSurface* SkSurface::NewScratchRenderTarget(GrContext* ctx, const SkImageInfo&
return NULL;
}
- return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), true, props, true));
+ return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), true, trm, true));
}
diff --git a/src/image/SkSurface_Raster.cpp b/src/image/SkSurface_Raster.cpp
index cd4f049c41..13f215589f 100644
--- a/src/image/SkSurface_Raster.cpp
+++ b/src/image/SkSurface_Raster.cpp
@@ -18,9 +18,8 @@ public:
static bool Valid(const SkImageInfo&, size_t rb = kIgnoreRowBytesValue);
SkSurface_Raster(const SkImageInfo&, void*, size_t rb,
- void (*releaseProc)(void* pixels, void* context), void* context,
- const SkSurfaceProps*);
- SkSurface_Raster(SkPixelRef*, const SkSurfaceProps*);
+ void (*releaseProc)(void* pixels, void* context), void* context);
+ SkSurface_Raster(SkPixelRef*);
virtual SkCanvas* onNewCanvas() SK_OVERRIDE;
virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE;
@@ -79,16 +78,15 @@ bool SkSurface_Raster::Valid(const SkImageInfo& info, size_t rowBytes) {
}
SkSurface_Raster::SkSurface_Raster(const SkImageInfo& info, void* pixels, size_t rb,
- void (*releaseProc)(void* pixels, void* context), void* context,
- const SkSurfaceProps* props)
- : INHERITED(info, props)
+ void (*releaseProc)(void* pixels, void* context), void* context)
+ : INHERITED(info)
{
fBitmap.installPixels(info, pixels, rb, NULL, releaseProc, context);
fWeOwnThePixels = false; // We are "Direct"
}
-SkSurface_Raster::SkSurface_Raster(SkPixelRef* pr, const SkSurfaceProps* props)
- : INHERITED(pr->info().width(), pr->info().height(), props)
+SkSurface_Raster::SkSurface_Raster(SkPixelRef* pr)
+ : INHERITED(pr->info().width(), pr->info().height())
{
const SkImageInfo& info = pr->info();
@@ -102,7 +100,7 @@ SkSurface_Raster::SkSurface_Raster(SkPixelRef* pr, const SkSurfaceProps* props)
}
SkCanvas* SkSurface_Raster::onNewCanvas() {
- return SkNEW_ARGS(SkCanvas, (fBitmap, this->props()));
+ return SkNEW_ARGS(SkCanvas, (fBitmap));
}
SkSurface* SkSurface_Raster::onNewSurface(const SkImageInfo& info) {
@@ -142,7 +140,7 @@ void SkSurface_Raster::onCopyOnWrite(ContentChangeMode mode) {
SkSurface* SkSurface::NewRasterDirectReleaseProc(const SkImageInfo& info, void* pixels, size_t rb,
void (*releaseProc)(void* pixels, void* context),
- void* context, const SkSurfaceProps* props) {
+ void* context) {
if (NULL == releaseProc) {
context = NULL;
}
@@ -153,15 +151,14 @@ SkSurface* SkSurface::NewRasterDirectReleaseProc(const SkImageInfo& info, void*
return NULL;
}
- return SkNEW_ARGS(SkSurface_Raster, (info, pixels, rb, releaseProc, context, props));
+ return SkNEW_ARGS(SkSurface_Raster, (info, pixels, rb, releaseProc, context));
}
-SkSurface* SkSurface::NewRasterDirect(const SkImageInfo& info, void* pixels, size_t rowBytes,
- const SkSurfaceProps* props) {
- return NewRasterDirectReleaseProc(info, pixels, rowBytes, NULL, NULL, props);
+SkSurface* SkSurface::NewRasterDirect(const SkImageInfo& info, void* pixels, size_t rowBytes) {
+ return NewRasterDirectReleaseProc(info, pixels, rowBytes, NULL, NULL);
}
-SkSurface* SkSurface::NewRaster(const SkImageInfo& info, const SkSurfaceProps* props) {
+SkSurface* SkSurface::NewRaster(const SkImageInfo& info) {
if (!SkSurface_Raster::Valid(info)) {
return NULL;
}
@@ -170,5 +167,5 @@ SkSurface* SkSurface::NewRaster(const SkImageInfo& info, const SkSurfaceProps* p
if (NULL == pr.get()) {
return NULL;
}
- return SkNEW_ARGS(SkSurface_Raster, (pr, props));
+ return SkNEW_ARGS(SkSurface_Raster, (pr));
}
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index aa6b521887..f4ea694451 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1261,8 +1261,8 @@ void SkPDFDevice::onDetachFromCanvas() {
fClipStack = NULL;
}
-SkSurface* SkPDFDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps& props) {
- return SkSurface::NewRaster(info, &props);
+SkSurface* SkPDFDevice::newSurface(const SkImageInfo& info) {
+ return SkSurface::NewRaster(info);
}
ContentEntry* SkPDFDevice::getLastContentEntry() {
diff --git a/src/ports/SkImageDecoder_CG.cpp b/src/ports/SkImageDecoder_CG.cpp
index 3e3075cc13..5b32502d8e 100644
--- a/src/ports/SkImageDecoder_CG.cpp
+++ b/src/ports/SkImageDecoder_CG.cpp
@@ -40,7 +40,6 @@ static CGDataProviderRef SkStreamToDataProvider(SkStream* stream) {
static CGImageSourceRef SkStreamToCGImageSource(SkStream* stream) {
CGDataProviderRef data = SkStreamToDataProvider(stream);
- SkASSERT(data);
CGImageSourceRef imageSrc = CGImageSourceCreateWithDataProvider(data, 0);
CGDataProviderRelease(data);
return imageSrc;
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index c8402dda4a..cce5dde538 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -161,7 +161,7 @@ public:
virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE;
- virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE;
+ virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE;
protected:
virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE;
@@ -474,8 +474,8 @@ SkBaseDevice* SkDeferredDevice::onCreateDevice(const SkImageInfo& info, Usage us
return immediateDevice()->createCompatibleDevice(info);
}
-SkSurface* SkDeferredDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps& props) {
- return this->immediateDevice()->newSurface(info, props);
+SkSurface* SkDeferredDevice::newSurface(const SkImageInfo& info) {
+ return this->immediateDevice()->newSurface(info);
}
bool SkDeferredDevice::onReadPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,