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

Unified Diff: src/gpu/GrSurface.cpp

Issue 596053002: Make "priv" classes for GrTexure and GrSurface. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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/gpu/GrSurface.cpp
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index d15cbdf6e26ccc7fd3b3745cb9ced18747132395..9816c95c5a4f92b4d15fb6e14f79046cedc19cee 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -6,6 +6,7 @@
*/
#include "GrSurface.h"
+#include "GrSurfacePriv.h"
#include "SkBitmap.h"
#include "SkGr.h"
@@ -26,8 +27,8 @@ bool GrSurface::savePixels(const char* filename) {
return false;
}
- bool result = readPixels(0, 0, this->width(), this->height(), kSkia8888_GrPixelConfig,
- bm.getPixels());
+ bool result = this->readPixels(0, 0, this->width(), this->height(), kSkia8888_GrPixelConfig,
+ bm.getPixels());
if (!result) {
SkDebugf("------ failed to read pixels for %s\n", filename);
return false;
@@ -80,3 +81,14 @@ bool GrSurface::hasPendingIO() const {
}
return false;
}
+
robertphillips 2014/09/29 13:34:27 It looks like GrSurfacePriv is careful to leave al
joshua.litt 2014/09/29 13:58:08 I think my preference is to move implementations o
bsalomon 2014/09/29 18:42:10 I don't feel strongly either way. The passthroughs
+bool GrSurface::isSameAs(const GrSurface* other) const {
+ const GrRenderTarget* thisRT = this->asRenderTarget();
+ if (thisRT) {
+ return thisRT == other->asRenderTarget();
+ } else {
+ const GrTexture* thisTex = this->asTexture();
+ SkASSERT(thisTex); // We must be one or the other
+ return thisTex == other->asTexture();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698