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

Unified Diff: src/image/SkSurface.cpp

Issue 551463004: introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: un-plumb props into device (not needed) 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
Index: src/image/SkSurface.cpp
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index 3a28e421a880df9ff6ae9962aa504c6bd63bb040..5249daf362dabd40e3b9d1b141889d3ede3b7f82 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -9,14 +9,26 @@
#include "SkImagePriv.h"
#include "SkCanvas.h"
+SkSurfaceProps::SkSurfaceProps()
+ : fOrigin(SkIPoint::Make(0, 0)), fDisallowFlags(0), fPixelGeometry(kLegacyLCD_SkPixelGeometry)
+{}
+
+SkSurfaceProps::SkSurfaceProps(int x, int y, uint32_t flags, SkPixelGeometry pg)
+ : fOrigin(SkIPoint::Make(x, y)), fDisallowFlags(flags), fPixelGeometry(pg)
+{}
+
///////////////////////////////////////////////////////////////////////////////
-SkSurface_Base::SkSurface_Base(int width, int height) : INHERITED(width, height) {
+SkSurface_Base::SkSurface_Base(int width, int height, const Props& props)
+ : INHERITED(width, height, props)
robertphillips 2014/09/16 14:15:19 Shouldn't the '{' be on the line above?
reed1 2014/09/16 18:16:01 Actually, I think when we have indented initialize
+{
fCachedCanvas = NULL;
fCachedImage = NULL;
}
-SkSurface_Base::SkSurface_Base(const SkImageInfo& info) : INHERITED(info) {
+SkSurface_Base::SkSurface_Base(const SkImageInfo& info, const Props& props)
+ : INHERITED(info, props)
robertphillips 2014/09/16 14:15:19 ditto?
+{
fCachedCanvas = NULL;
fCachedImage = NULL;
}
@@ -74,13 +86,17 @@ static SkSurface_Base* asSB(SkSurface* surface) {
///////////////////////////////////////////////////////////////////////////////
-SkSurface::SkSurface(int width, int height) : fWidth(width), fHeight(height) {
+SkSurface::SkSurface(int width, int height, const Props& props)
+ : fProps(props), fWidth(width), fHeight(height)
robertphillips 2014/09/16 14:15:19 ditto?
+{
SkASSERT(fWidth >= 0);
SkASSERT(fHeight >= 0);
fGenerationID = 0;
}
-SkSurface::SkSurface(const SkImageInfo& info) : fWidth(info.width()), fHeight(info.height()) {
+SkSurface::SkSurface(const SkImageInfo& info, const Props& props)
+ : fProps(props), fWidth(info.width()), fHeight(info.height())
robertphillips 2014/09/16 14:15:19 ditto?
+{
SkASSERT(fWidth >= 0);
SkASSERT(fHeight >= 0);
fGenerationID = 0;

Powered by Google App Engine
This is Rietveld 408576698