diff options
author | reed <reed@chromium.org> | 2014-06-09 19:52:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-06-09 19:52:07 -0700 |
commit | 6c22573edb234ad14df947278cfed010669a39a7 (patch) | |
tree | ede271bf82d823809c12d9b4ef3801dc7d6ddd73 /tools | |
parent | 7c5c9da436194c75d91797f114a87a6119ca255d (diff) | |
download | skia-6c22573edb234ad14df947278cfed010669a39a7.tar.gz |
hide SkBitmap::setConfig
patch from issue 325733002
TBR=scroggo
Author: reed@chromium.org
Review URL: https://codereview.chromium.org/322963002
Diffstat (limited to 'tools')
-rw-r--r-- | tools/picture_utils.cpp | 3 | ||||
-rw-r--r-- | tools/skdiff_utils.cpp | 6 | ||||
-rw-r--r-- | tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp | 4 |
3 files changed, 4 insertions, 9 deletions
diff --git a/tools/picture_utils.cpp b/tools/picture_utils.cpp index c698a69835..4e6c81e417 100644 --- a/tools/picture_utils.cpp +++ b/tools/picture_utils.cpp @@ -97,8 +97,7 @@ namespace sk_tools { } void setup_bitmap(SkBitmap* bitmap, int width, int height) { - bitmap->setConfig(SkBitmap::kARGB_8888_Config, width, height); - bitmap->allocPixels(); + bitmap->allocN32Pixels(width, height); bitmap->eraseColor(SK_ColorTRANSPARENT); } diff --git a/tools/skdiff_utils.cpp b/tools/skdiff_utils.cpp index 5ca3d8085d..5c9aae275a 100644 --- a/tools/skdiff_utils.cpp +++ b/tools/skdiff_utils.cpp @@ -144,11 +144,9 @@ void create_and_write_diff_image(DiffRecord* drp, if (w != drp->fComparison.fBitmap.width() || h != drp->fComparison.fBitmap.height()) { drp->fResult = DiffRecord::kDifferentSizes_Result; } else { - drp->fDifference.fBitmap.setConfig(SkBitmap::kARGB_8888_Config, w, h); - drp->fDifference.fBitmap.allocPixels(); + drp->fDifference.fBitmap.allocN32Pixels(w, h); - drp->fWhite.fBitmap.setConfig(SkBitmap::kARGB_8888_Config, w, h); - drp->fWhite.fBitmap.allocPixels(); + drp->fWhite.fBitmap.allocN32Pixels(w, h); SkASSERT(DiffRecord::kUnknown_Result == drp->fResult); compute_diff(drp, dmp, colorThreshold); diff --git a/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp b/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp index 27c7a135d7..768bfc7d21 100644 --- a/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp +++ b/tools/skpdiff/SkDifferentPixelsMetric_cpu.cpp @@ -30,9 +30,7 @@ bool SkDifferentPixelsMetric::diff(SkBitmap* baseline, SkBitmap* test, bool comp // Prepare the POI alpha mask if needed if (computeMask) { - result->poiAlphaMask.setConfig(SkBitmap::kA8_Config, width, height); - result->poiAlphaMask.allocPixels(); - result->poiAlphaMask.lockPixels(); + result->poiAlphaMask.allocPixels(SkImageInfo::MakeA8(width, height)); result->poiAlphaMask.eraseARGB(SK_AlphaOPAQUE, 0, 0, 0); } |