aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkSurface_Raster.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-04-28 15:43:35 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-28 20:14:55 +0000
commita6e976aac8eaaacc2f802ac8f65b056e5b78e249 (patch)
tree1f32ae32d93aed8d048eb515b2d3135807e0dab6 /src/image/SkSurface_Raster.cpp
parentdc87c95382d5beab7fdae2e654d6de568fbe1671 (diff)
Only store width and height on SkPixelRef (part 1)
Relanding https://skia-review.googlesource.com/c/14105/ in pieces to try to diagnose problems with the Chrome roll. Bug: skia:6535 Change-Id: Ic321c437ecd3cb7940a48fd73fc22b192804c67a Reviewed-on: https://skia-review.googlesource.com/14650 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/image/SkSurface_Raster.cpp')
-rw-r--r--src/image/SkSurface_Raster.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/image/SkSurface_Raster.cpp b/src/image/SkSurface_Raster.cpp
index 2de1ed70d3..c4796c402f 100644
--- a/src/image/SkSurface_Raster.cpp
+++ b/src/image/SkSurface_Raster.cpp
@@ -20,7 +20,7 @@ public:
SkSurface_Raster(const SkImageInfo&, void*, size_t rb,
void (*releaseProc)(void* pixels, void* context), void* context,
const SkSurfaceProps*);
- SkSurface_Raster(sk_sp<SkPixelRef>, const SkSurfaceProps*);
+ SkSurface_Raster(const SkImageInfo& info, sk_sp<SkPixelRef>, const SkSurfaceProps*);
SkCanvas* onNewCanvas() override;
sk_sp<SkSurface> onNewSurface(const SkImageInfo&) override;
@@ -108,11 +108,10 @@ SkSurface_Raster::SkSurface_Raster(const SkImageInfo& info, void* pixels, size_t
fWeOwnThePixels = false; // We are "Direct"
}
-SkSurface_Raster::SkSurface_Raster(sk_sp<SkPixelRef> pr, const SkSurfaceProps* props)
- : INHERITED(pr->info().width(), pr->info().height(), props)
+SkSurface_Raster::SkSurface_Raster(const SkImageInfo& info, sk_sp<SkPixelRef> pr,
+ const SkSurfaceProps* props)
+ : INHERITED(pr->width(), pr->height(), props)
{
- const SkImageInfo& info = pr->info();
-
fBitmap.setInfo(info, pr->rowBytes());
fRowBytes = pr->rowBytes(); // we track this, so that subsequent re-allocs will match
fBitmap.setPixelRef(std::move(pr), 0, 0);
@@ -215,5 +214,5 @@ sk_sp<SkSurface> SkSurface::MakeRaster(const SkImageInfo& info, size_t rowBytes,
if (rowBytes) {
SkASSERT(pr->rowBytes() == rowBytes);
}
- return sk_make_sp<SkSurface_Raster>(std::move(pr), props);
+ return sk_make_sp<SkSurface_Raster>(info, std::move(pr), props);
}