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

Unified Diff: src/image/SkImage_Raster.cpp

Issue 132643007: Revert "Revert of https://codereview.chromium.org/129423002/" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | « src/image/SkImage_Base.h ('k') | src/image/SkSurface_Raster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Raster.cpp
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index 32d53fc52ec2b4cf7322e0fbd8790fe595cd959c..b80fbb3a542bf6d66610ac0cf47f2f9f8ecd78d7 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -58,7 +58,7 @@ public:
virtual bool getROPixels(SkBitmap*) const SK_OVERRIDE;
// exposed for SkSurface_Raster via SkNewImageFromPixelRef
- SkImage_Raster(const SkImageInfo&, SkPixelRef*, size_t rowBytes);
+ SkImage_Raster(SkPixelRef*);
SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); }
@@ -84,18 +84,16 @@ SkImage* SkImage_Raster::NewEmpty() {
SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes)
: INHERITED(info.fWidth, info.fHeight) {
- fBitmap.setConfig(info, rowBytes);
SkAutoTUnref<SkPixelRef> ref(
SkMallocPixelRef::NewWithData(info, rowBytes, NULL, data, 0));
- fBitmap.setPixelRef(ref);
+ fBitmap.installPixelRef(ref);
fBitmap.setImmutable();
}
-SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, size_t rowBytes)
- : INHERITED(info.fWidth, info.fHeight)
+SkImage_Raster::SkImage_Raster(SkPixelRef* pr)
+ : INHERITED(pr->info())
{
- fBitmap.setConfig(info, rowBytes);
- fBitmap.setPixelRef(pr);
+ fBitmap.installPixelRef(pr);
}
SkImage_Raster::~SkImage_Raster() {}
@@ -155,9 +153,8 @@ SkImage* SkImage::NewRasterData(const SkImageInfo& info, SkData* pixelData, size
return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes));
}
-SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr,
- size_t rowBytes) {
- return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes));
+SkImage* SkNewImageFromPixelRef(SkPixelRef* pr) {
+ return SkNEW_ARGS(SkImage_Raster, (pr));
}
SkPixelRef* SkBitmapImageGetPixelRef(SkImage* image) {
« no previous file with comments | « src/image/SkImage_Base.h ('k') | src/image/SkSurface_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698