diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-13 20:39:14 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-13 20:39:14 +0000 |
commit | e13af711d4ff9031c9ed3054a4c33a56a0c62e1f (patch) | |
tree | 6ffdbe491bde75147efead8c9d21b5d6ebae045e /src/core | |
parent | f0b56e74485d59465194b21f89fa3bc3a7962ac6 (diff) |
Reason for revert: broken tests
TBR=
NOTREECHECKS=true
NOTRY=true
BUG=
Author: reed@google.com
Review URL: https://codereview.chromium.org/134843008
git-svn-id: http://skia.googlecode.com/svn/trunk@13058 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkBitmap.cpp | 24 | ||||
-rw-r--r-- | src/core/SkImageFilterUtils.cpp | 10 | ||||
-rw-r--r-- | src/core/SkScaledImageCache.cpp | 12 |
3 files changed, 16 insertions, 30 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index 6615b1c52b..f950e28cdc 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -333,30 +333,6 @@ bool SkBitmap::setAlphaType(SkAlphaType alphaType) { return true; } -SkPixelRef* SkBitmap::installPixelRef(SkPixelRef* pr, const SkIRect* subset) { - if (NULL == pr) { - this->reset(); - return NULL; - } - - const SkImageInfo& info = pr->info(); - - fConfig = SkColorTypeToBitmapConfig(info.fColorType); - fAlphaType = info.fAlphaType; - fBytesPerPixel = info.bytesPerPixel(); - // not known until we're locked - fRowBytes = 0; - - SkIRect bounds = { 0, 0, info.fWidth, info.fHeight }; - if (subset && !bounds.intersect(*subset)) { - bounds.setEmpty(); - } - - fWidth = bounds.width(); - fHeight = bounds.height(); - return this->setPixelRef(pr, bounds.left(), bounds.top()); -} - void SkBitmap::updatePixelsFromRef() const { if (NULL != fPixelRef) { if (fPixelLockCount > 0) { diff --git a/src/core/SkImageFilterUtils.cpp b/src/core/SkImageFilterUtils.cpp index 076ef9bb91..92fe67e84c 100644 --- a/src/core/SkImageFilterUtils.cpp +++ b/src/core/SkImageFilterUtils.cpp @@ -15,8 +15,14 @@ #include "SkGr.h" bool SkImageFilterUtils::WrapTexture(GrTexture* texture, int width, int height, SkBitmap* result) { - SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); - result->installPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); + SkImageInfo info = { + width, + height, + kPMColor_SkColorType, + kPremul_SkAlphaType, + }; + result->setConfig(info); + result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); return true; } diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp index 68663f03b0..fc3148bdd8 100644 --- a/src/core/SkScaledImageCache.cpp +++ b/src/core/SkScaledImageCache.cpp @@ -293,10 +293,14 @@ bool SkScaledImageCacheDiscardableAllocator::allocPixelRef(SkBitmap* bitmap, return false; } - SkImageInfo info = SkImageInfo::MakeN32(bitmap->width(), bitmap->height(), - bitmap->alphaType()); - - bitmap->installPixelRef(SkNEW_ARGS(SkOneShotDiscardablePixelRef, + SkImageInfo info = { + bitmap->width(), + bitmap->height(), + kPMColor_SkColorType, + bitmap->alphaType() + }; + + bitmap->setPixelRef(SkNEW_ARGS(SkOneShotDiscardablePixelRef, (info, dm, bitmap->rowBytes())))->unref(); bitmap->lockPixels(); return bitmap->readyToDraw(); |