add SkImageInfo to SkGrPixelRef constructor, to prep for larger CL
BUG=
Review URL: https://codereview.chromium.org/104923011
git-svn-id: http://skia.googlecode.com/svn/trunk@12559 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp
index dc5d755..0129426 100644
--- a/src/gpu/SkGrPixelRef.cpp
+++ b/src/gpu/SkGrPixelRef.cpp
@@ -117,6 +117,23 @@
SkSafeRef(surface);
}
+SkGrPixelRef::SkGrPixelRef(const SkImageInfo&, GrSurface* surface, bool transferCacheLock) {
+ // TODO: figure out if this is responsible for Chrome canvas errors
+#if 0
+ // The GrTexture has a ref to the GrRenderTarget but not vice versa.
+ // If the GrTexture exists take a ref to that (rather than the render
+ // target)
+ fSurface = surface->asTexture();
+#else
+ fSurface = NULL;
+#endif
+ if (NULL == fSurface) {
+ fSurface = surface;
+ }
+ fUnlock = transferCacheLock;
+ SkSafeRef(surface);
+}
+
SkGrPixelRef::~SkGrPixelRef() {
if (fUnlock) {
GrContext* context = fSurface->getContext();