Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: src/core/SkPictureShader.cpp

Issue 1652943002: SkPictureShader cleanup (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureShader.cpp
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp
index 82d6096be5e6657a25ec757ce5b5a4caf1a11b44..44f6ef10b59254019fc0f0fd2804a2a967b0e82b 100644
--- a/src/core/SkPictureShader.cpp
+++ b/src/core/SkPictureShader.cpp
@@ -11,7 +11,6 @@
#include "SkBitmapProcShader.h"
#include "SkCanvas.h"
#include "SkImage.h"
-#include "SkImageGenerator.h"
#include "SkMatrixUtils.h"
#include "SkPicture.h"
#include "SkReadBuffer.h"
@@ -220,16 +219,8 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& viewMatrix, const SkM
tileMatrix.setRectToRect(fTile, SkRect::MakeIWH(tileSize.width(), tileSize.height()),
SkMatrix::kFill_ScaleToFit);
- SkAutoTDelete<SkImageGenerator> tileGenerator(
- SkImageGenerator::NewFromPicture(tileSize, fPicture, &tileMatrix, nullptr));
- if (!tileGenerator) {
- return nullptr;
- }
-
- // Grab this before the generator goes poof!
- const SkImageInfo tileInfo = tileGenerator->getInfo();
-
- SkAutoTUnref<SkImage> tileImage(SkImage::NewFromGenerator(tileGenerator.detach()));
+ SkAutoTUnref<SkImage> tileImage(
+ SkImage::NewFromPicture(fPicture, tileSize, &tileMatrix, nullptr));
if (!tileImage) {
return nullptr;
}
@@ -238,6 +229,7 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& viewMatrix, const SkM
shaderMatrix.preScale(1 / tileScale.width(), 1 / tileScale.height());
tileShader.reset(tileImage->newShader(fTmx, fTmy, &shaderMatrix));
+ const SkImageInfo tileInfo = SkImageInfo::MakeN32Premul(tileSize);
SkResourceCache::Add(new BitmapShaderRec(key, tileShader.get(),
tileInfo.getSafeSize(tileInfo.minRowBytes())));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698