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

Unified Diff: gm/showmiplevels.cpp

Issue 1598803002: use pixmaps in mipmap api (Closed) Base URL: https://skia.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 | src/core/SkBitmapController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/showmiplevels.cpp
diff --git a/gm/showmiplevels.cpp b/gm/showmiplevels.cpp
index 23359f046ea2861bc43c73ef83c63f505e6c3df5..7fc40ce029884a9b1ea8b06692d30c2117bdd48f 100644
--- a/gm/showmiplevels.cpp
+++ b/gm/showmiplevels.cpp
@@ -151,23 +151,19 @@ protected:
SkMipMap::Level level;
SkScalar scale = 0.5f;
while (mm->extractLevel(scale, &level)) {
- SkImageInfo info = SkImageInfo::Make(level.fWidth, level.fHeight,
- baseBM.colorType(), baseBM.alphaType());
- SkPixmap levelPM{ info, level.fPixels, level.fRowBytes };
-
- SkBitmap bm = func(prevPM, levelPM);
+ SkBitmap bm = func(prevPM, level.fPixmap);
DrawAndFrame(canvas, bm, x, y);
- if (info.width() <= 2 || info.height() <= 2) {
+ if (level.fPixmap.width() <= 2 || level.fPixmap.height() <= 2) {
break;
}
if (index & 1) {
- x += info.width() + 4;
+ x += level.fPixmap.width() + 4;
} else {
- y += info.height() + 4;
+ y += level.fPixmap.height() + 4;
}
scale /= 2;
- prevPM = levelPM;
+ prevPM = level.fPixmap;
index += 1;
}
}
@@ -263,20 +259,17 @@ protected:
SkMipMap::Level level;
SkScalar scale = 0.5f;
while (mm->extractLevel(scale, &level)) {
- SkImageInfo info = SkImageInfo::Make(level.fWidth, level.fHeight,
- baseBM.colorType(), baseBM.alphaType());
-
SkBitmap bm;
- bm.installPixels(info, level.fPixels, level.fRowBytes);
+ bm.installPixels(level.fPixmap);
DrawAndFrame(canvas, bm, x, y);
- if (info.width() <= 2 || info.height() <= 2) {
+ if (level.fPixmap.width() <= 2 || level.fPixmap.height() <= 2) {
break;
}
if (index & 1) {
- x += info.width() + 4;
+ x += level.fPixmap.width() + 4;
} else {
- y += info.height() + 4;
+ y += level.fPixmap.height() + 4;
}
scale /= 2;
index += 1;
« no previous file with comments | « no previous file | src/core/SkBitmapController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698