OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkCanvasPriv.h" | 10 #include "SkCanvasPriv.h" |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 | 1279 |
1280 SkImageInfo info = make_layer_info(device->imageInfo(), ir.width(), ir.heigh
t(), isOpaque, | 1280 SkImageInfo info = make_layer_info(device->imageInfo(), ir.width(), ir.heigh
t(), isOpaque, |
1281 paint); | 1281 paint); |
1282 | 1282 |
1283 bool forceSpriteOnRestore = false; | 1283 bool forceSpriteOnRestore = false; |
1284 { | 1284 { |
1285 const bool preserveLCDText = kOpaque_SkAlphaType == info.alphaType() || | 1285 const bool preserveLCDText = kOpaque_SkAlphaType == info.alphaType() || |
1286 (saveLayerFlags & kPreserveLCDText_SaveLaye
rFlag); | 1286 (saveLayerFlags & kPreserveLCDText_SaveLaye
rFlag); |
1287 const SkBaseDevice::TileUsage usage = SkBaseDevice::kNever_TileUsage; | 1287 const SkBaseDevice::TileUsage usage = SkBaseDevice::kNever_TileUsage; |
1288 const SkBaseDevice::CreateInfo createInfo = SkBaseDevice::CreateInfo(inf
o, usage, geo, | 1288 const SkBaseDevice::CreateInfo createInfo = SkBaseDevice::CreateInfo(inf
o, usage, geo, |
1289 pres
erveLCDText, false); | 1289 pre
serveLCDText); |
1290 SkBaseDevice* newDev = device->onCreateDevice(createInfo, paint); | 1290 SkBaseDevice* newDev = device->onCreateDevice(createInfo, paint); |
1291 if (nullptr == newDev) { | 1291 if (nullptr == newDev) { |
1292 // If onCreateDevice didn't succeed, try raster (e.g. PDF couldn't h
andle the paint) | 1292 // If onCreateDevice didn't succeed, try raster (e.g. PDF couldn't h
andle the paint) |
1293 const SkSurfaceProps surfaceProps(fProps.flags(), createInfo.fPixelG
eometry); | 1293 const SkSurfaceProps surfaceProps(fProps.flags(), createInfo.fPixelG
eometry); |
1294 newDev = SkBitmapDevice::Create(createInfo.fInfo, surfaceProps); | 1294 newDev = SkBitmapDevice::Create(createInfo.fInfo, surfaceProps); |
1295 if (nullptr == newDev) { | 1295 if (nullptr == newDev) { |
1296 SkErrorInternals::SetError(kInternalError_SkError, | 1296 SkErrorInternals::SetError(kInternalError_SkError, |
1297 "Unable to create device for layer.")
; | 1297 "Unable to create device for layer.")
; |
1298 return; | 1298 return; |
1299 } | 1299 } |
(...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3134 | 3134 |
3135 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3135 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
3136 fCanvas->restoreToCount(fSaveCount); | 3136 fCanvas->restoreToCount(fSaveCount); |
3137 } | 3137 } |
3138 | 3138 |
3139 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API | 3139 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API |
3140 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { | 3140 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { |
3141 return this->makeSurface(info, props).release(); | 3141 return this->makeSurface(info, props).release(); |
3142 } | 3142 } |
3143 #endif | 3143 #endif |
OLD | NEW |