| Index: src/gpu/SkGpuDevice.cpp
|
| diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
|
| index 02dca83ee0e86892a1a2d4fd267d17d8f465bb52..7ce3446b72e59289f8741fd20bf8355ae3bfd4a3 100644
|
| --- a/src/gpu/SkGpuDevice.cpp
|
| +++ b/src/gpu/SkGpuDevice.cpp
|
| @@ -133,15 +133,15 @@ public:
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
|
|
| -SkGpuDevice* SkGpuDevice::Create(GrSurface* surface, unsigned flags) {
|
| +SkGpuDevice* SkGpuDevice::Create(GrSurface* surface, const SkSurfaceProps& props, unsigned flags) {
|
| SkASSERT(surface);
|
| if (NULL == surface->asRenderTarget() || surface->wasDestroyed()) {
|
| return NULL;
|
| }
|
| - return SkNEW_ARGS(SkGpuDevice, (surface, flags));
|
| + return SkNEW_ARGS(SkGpuDevice, (surface, props, flags));
|
| }
|
|
|
| -SkGpuDevice::SkGpuDevice(GrSurface* surface, unsigned flags) {
|
| +SkGpuDevice::SkGpuDevice(GrSurface* surface, const SkSurfaceProps& props, unsigned flags) {
|
|
|
| fDrawProcs = NULL;
|
|
|
| @@ -156,13 +156,15 @@ SkGpuDevice::SkGpuDevice(GrSurface* surface, unsigned flags) {
|
| 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,
|
| - int sampleCount) {
|
| + const SkSurfaceProps& props, int sampleCount) {
|
| if (kUnknown_SkColorType == origInfo.colorType() ||
|
| origInfo.width() < 0 || origInfo.height() < 0) {
|
| return NULL;
|
| @@ -194,7 +196,7 @@ SkGpuDevice* SkGpuDevice::Create(GrContext* context, const SkImageInfo& origInfo
|
| return NULL;
|
| }
|
|
|
| - return SkNEW_ARGS(SkGpuDevice, (texture.get()));
|
| + return SkNEW_ARGS(SkGpuDevice, (texture.get(), props));
|
| }
|
|
|
| SkGpuDevice::~SkGpuDevice() {
|
| @@ -1805,7 +1807,7 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const SkImageInfo& info, Usage usage)
|
| texture.reset(fContext->createUncachedTexture(desc, NULL, 0));
|
| #endif
|
| if (texture.get()) {
|
| - return SkGpuDevice::Create(texture, flags);
|
| + return SkGpuDevice::Create(texture, SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType), flags);
|
| } else {
|
| GrPrintf("---- failed to create compatible device texture [%d %d]\n",
|
| info.width(), info.height());
|
| @@ -1813,8 +1815,8 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const SkImageInfo& info, Usage usage)
|
| }
|
| }
|
|
|
| -SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info) {
|
| - return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples());
|
| +SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps& props) {
|
| + return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples(), &props);
|
| }
|
|
|
| void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) {
|
|
|