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

Unified Diff: src/image/SkSurface_Raster.cpp

Issue 551463004: introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add new file Created 6 years, 3 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/SkSurface_Gpu.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface_Raster.cpp
diff --git a/src/image/SkSurface_Raster.cpp b/src/image/SkSurface_Raster.cpp
index 13f215589f190f9aa0cbb2d45ac5a1ff841c83e6..cd4f049c4166be5dd76edc6bf4534cd9b96771db 100644
--- a/src/image/SkSurface_Raster.cpp
+++ b/src/image/SkSurface_Raster.cpp
@@ -18,8 +18,9 @@ public:
static bool Valid(const SkImageInfo&, size_t rb = kIgnoreRowBytesValue);
SkSurface_Raster(const SkImageInfo&, void*, size_t rb,
- void (*releaseProc)(void* pixels, void* context), void* context);
- SkSurface_Raster(SkPixelRef*);
+ void (*releaseProc)(void* pixels, void* context), void* context,
+ const SkSurfaceProps*);
+ SkSurface_Raster(SkPixelRef*, const SkSurfaceProps*);
virtual SkCanvas* onNewCanvas() SK_OVERRIDE;
virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE;
@@ -78,15 +79,16 @@ bool SkSurface_Raster::Valid(const SkImageInfo& info, size_t rowBytes) {
}
SkSurface_Raster::SkSurface_Raster(const SkImageInfo& info, void* pixels, size_t rb,
- void (*releaseProc)(void* pixels, void* context), void* context)
- : INHERITED(info)
+ void (*releaseProc)(void* pixels, void* context), void* context,
+ const SkSurfaceProps* props)
+ : INHERITED(info, props)
{
fBitmap.installPixels(info, pixels, rb, NULL, releaseProc, context);
fWeOwnThePixels = false; // We are "Direct"
}
-SkSurface_Raster::SkSurface_Raster(SkPixelRef* pr)
- : INHERITED(pr->info().width(), pr->info().height())
+SkSurface_Raster::SkSurface_Raster(SkPixelRef* pr, const SkSurfaceProps* props)
+ : INHERITED(pr->info().width(), pr->info().height(), props)
{
const SkImageInfo& info = pr->info();
@@ -100,7 +102,7 @@ SkSurface_Raster::SkSurface_Raster(SkPixelRef* pr)
}
SkCanvas* SkSurface_Raster::onNewCanvas() {
- return SkNEW_ARGS(SkCanvas, (fBitmap));
+ return SkNEW_ARGS(SkCanvas, (fBitmap, this->props()));
}
SkSurface* SkSurface_Raster::onNewSurface(const SkImageInfo& info) {
@@ -140,7 +142,7 @@ void SkSurface_Raster::onCopyOnWrite(ContentChangeMode mode) {
SkSurface* SkSurface::NewRasterDirectReleaseProc(const SkImageInfo& info, void* pixels, size_t rb,
void (*releaseProc)(void* pixels, void* context),
- void* context) {
+ void* context, const SkSurfaceProps* props) {
if (NULL == releaseProc) {
context = NULL;
}
@@ -151,14 +153,15 @@ SkSurface* SkSurface::NewRasterDirectReleaseProc(const SkImageInfo& info, void*
return NULL;
}
- return SkNEW_ARGS(SkSurface_Raster, (info, pixels, rb, releaseProc, context));
+ return SkNEW_ARGS(SkSurface_Raster, (info, pixels, rb, releaseProc, context, props));
}
-SkSurface* SkSurface::NewRasterDirect(const SkImageInfo& info, void* pixels, size_t rowBytes) {
- return NewRasterDirectReleaseProc(info, pixels, rowBytes, NULL, NULL);
+SkSurface* SkSurface::NewRasterDirect(const SkImageInfo& info, void* pixels, size_t rowBytes,
+ const SkSurfaceProps* props) {
+ return NewRasterDirectReleaseProc(info, pixels, rowBytes, NULL, NULL, props);
}
-SkSurface* SkSurface::NewRaster(const SkImageInfo& info) {
+SkSurface* SkSurface::NewRaster(const SkImageInfo& info, const SkSurfaceProps* props) {
if (!SkSurface_Raster::Valid(info)) {
return NULL;
}
@@ -167,5 +170,5 @@ SkSurface* SkSurface::NewRaster(const SkImageInfo& info) {
if (NULL == pr.get()) {
return NULL;
}
- return SkNEW_ARGS(SkSurface_Raster, (pr));
+ return SkNEW_ARGS(SkSurface_Raster, (pr, props));
}
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698