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

Unified Diff: src/image/SkSurface.cpp

Issue 128933004: use SkImageInfo directly, instead of converting to SkBitmap::Config (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 | « include/core/SkSurface.h ('k') | src/image/SkSurface_Base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface.cpp
diff --git a/src/image/SkSurface.cpp b/src/image/SkSurface.cpp
index 2dde36b96d95c89ce8834d5cbc3c783004971809..cb029c8aea3b0e2672d1c840a35eb419a50c31e8 100644
--- a/src/image/SkSurface.cpp
+++ b/src/image/SkSurface.cpp
@@ -16,6 +16,11 @@ SkSurface_Base::SkSurface_Base(int width, int height) : INHERITED(width, height)
fCachedImage = NULL;
}
+SkSurface_Base::SkSurface_Base(const SkImageInfo& info) : INHERITED(info) {
+ fCachedCanvas = NULL;
+ fCachedImage = NULL;
+}
+
SkSurface_Base::~SkSurface_Base() {
// in case the canvas outsurvives us, we null the callback
if (fCachedCanvas) {
@@ -73,8 +78,17 @@ static SkSurface_Base* asSB(SkSurface* surface) {
///////////////////////////////////////////////////////////////////////////////
SkSurface::SkSurface(int width, int height) : fWidth(width), fHeight(height) {
- SkASSERT(width >= 0);
- SkASSERT(height >= 0);
+ SkASSERT(fWidth >= 0);
+ SkASSERT(fHeight >= 0);
+ fGenerationID = 0;
+}
+
+SkSurface::SkSurface(const SkImageInfo& info)
+ : fWidth(info.fWidth)
+ , fHeight(info.fHeight)
+{
+ SkASSERT(fWidth >= 0);
+ SkASSERT(fHeight >= 0);
fGenerationID = 0;
}
« no previous file with comments | « include/core/SkSurface.h ('k') | src/image/SkSurface_Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698