aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-04-17 11:02:51 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-17 15:33:36 +0000
commit4edb5d219eb99aa1e8fbe5e37260d3b34314e54b (patch)
tree5e9fedc4e0e59db2467a19fe7d4f36030d0d6694 /src/gpu
parent12e946b4bfdf598bffb276776ea6e25439e25265 (diff)
hide lockpixels api behind flag
guarded by SK_SUPPORT_OBSOLETE_LOCKPIXELS needs https://codereview.chromium.org/2820873002/# to land first Bug: skia:6481 Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09 Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09 Reviewed-on: https://skia-review.googlesource.com/13580 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/SkGpuDevice.cpp6
-rw-r--r--src/gpu/SkGr.cpp10
-rw-r--r--src/gpu/effects/GrTextureStripAtlas.cpp2
3 files changed, 2 insertions, 16 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 11ed637250..7046f1cefe 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -957,12 +957,6 @@ void SkGpuDevice::drawTiledBitmap(const SkBitmap& bitmap,
SK_HISTOGRAM_BOOLEAN("DrawTiled", true);
LogDrawScaleFactor(viewMatrix, origPaint.getFilterQuality());
- // The following pixel lock is technically redundant, but it is desirable
- // to lock outside of the tile loop to prevent redecoding the whole image
- // at each tile in cases where 'bitmap' holds an SkDiscardablePixelRef that
- // is larger than the limit of the discardable memory pool.
- SkAutoLockPixels alp(bitmap);
-
const SkPaint* paint = &origPaint;
SkPaint tempPaint;
if (origPaint.isAntiAlias() && !fRenderTargetContext->isUnifiedMultisampled()) {
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 84be09e357..e4b31558ae 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -93,7 +93,6 @@ GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data,
//////////////////////////////////////////////////////////////////////////////
sk_sp<GrTextureProxy> GrUploadBitmapToTextureProxy(GrResourceProvider* resourceProvider,
const SkBitmap& bitmap) {
- SkAutoLockPixels alp(bitmap);
if (!bitmap.readyToDraw()) {
return nullptr;
}
@@ -212,15 +211,10 @@ sk_sp<GrTextureProxy> GrGenerateMipMapsAndUploadToTextureProxy(GrContext* ctx,
GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bitmap.info(), *ctx->caps());
- SkAutoPixmapUnlock srcUnlocker;
- if (!bitmap.requestLock(&srcUnlocker)) {
+ SkPixmap pixmap;
+ if (!bitmap.peekPixels(&pixmap)) {
return nullptr;
}
- const SkPixmap& pixmap = srcUnlocker.pixmap();
- // Try to catch where we might have returned nullptr for src crbug.com/492818
- if (nullptr == pixmap.addr()) {
- sk_throw();
- }
std::unique_ptr<SkMipMap> mipmaps(SkMipMap::Build(pixmap, colorMode, nullptr));
if (!mipmaps) {
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp
index 26ef5963c1..72817b2133 100644
--- a/src/gpu/effects/GrTextureStripAtlas.cpp
+++ b/src/gpu/effects/GrTextureStripAtlas.cpp
@@ -153,8 +153,6 @@ int GrTextureStripAtlas::lockRow(const SkBitmap& bitmap) {
fKeyTable.insert(index, 1, &row);
rowNumber = static_cast<int>(row - fRows);
- SkAutoLockPixels lock(bitmap);
-
SkASSERT(bitmap.width() == fDesc.fWidth);
SkASSERT(bitmap.height() == fDesc.fRowHeight);