aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkSpecialSurface.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-04-27 16:52:29 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-27 21:19:32 +0000
commit2cbb6662e329981840f90ef4edd62f70f69e6030 (patch)
tree63e5d20cba696369a6ca15495fafd6afac14a866 /src/core/SkSpecialSurface.cpp
parent0122af08f6af0dee490e1a4f35b552377d0d4753 (diff)
Only store width and height on SkPixelRef
Bug: skia:6535 Change-Id: Id91e8d1e82f593be7d4b23ca5abde752f2666a77 Reviewed-on: https://skia-review.googlesource.com/14105 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/core/SkSpecialSurface.cpp')
-rw-r--r--src/core/SkSpecialSurface.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/SkSpecialSurface.cpp b/src/core/SkSpecialSurface.cpp
index 33ef97e5bd..9564a14f48 100644
--- a/src/core/SkSpecialSurface.cpp
+++ b/src/core/SkSpecialSurface.cpp
@@ -63,12 +63,11 @@ sk_sp<SkSpecialImage> SkSpecialSurface::makeImageSnapshot() {
class SkSpecialSurface_Raster : public SkSpecialSurface_Base {
public:
- SkSpecialSurface_Raster(sk_sp<SkPixelRef> pr,
+ SkSpecialSurface_Raster(const SkImageInfo& info,
+ sk_sp<SkPixelRef> pr,
const SkIRect& subset,
const SkSurfaceProps* props)
: INHERITED(subset, props) {
- const SkImageInfo& info = pr->info();
-
fBitmap.setInfo(info, info.minRowBytes());
fBitmap.setPixelRef(std::move(pr), 0, 0);
@@ -93,7 +92,7 @@ private:
sk_sp<SkSpecialSurface> SkSpecialSurface::MakeFromBitmap(const SkIRect& subset, SkBitmap& bm,
const SkSurfaceProps* props) {
- return sk_make_sp<SkSpecialSurface_Raster>(sk_ref_sp(bm.pixelRef()), subset, props);
+ return sk_make_sp<SkSpecialSurface_Raster>(bm.info(), sk_ref_sp(bm.pixelRef()), subset, props);
}
sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRaster(const SkImageInfo& info,
@@ -103,9 +102,9 @@ sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRaster(const SkImageInfo& info,
return nullptr;
}
- const SkIRect subset = SkIRect::MakeWH(pr->info().width(), pr->info().height());
+ const SkIRect subset = SkIRect::MakeWH(info.width(), info.height());
- return sk_make_sp<SkSpecialSurface_Raster>(std::move(pr), subset, props);
+ return sk_make_sp<SkSpecialSurface_Raster>(info, std::move(pr), subset, props);
}
#if SK_SUPPORT_GPU