aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-09 13:41:06 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-09 13:41:06 +0000
commit61867875ef8083ca39a76acc8ffeedd2623d4b35 (patch)
tree75d0135d22f63d61fd2a2aee3d20384c244a5ad4 /src
parentbc451d2823e5b4a14b7d4382a9bd2b5f15c2325e (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/gpu/SkGrPixelRef.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp
index dc5d7558f0..012942667c 100644
--- a/src/gpu/SkGrPixelRef.cpp
+++ b/src/gpu/SkGrPixelRef.cpp
@@ -117,6 +117,23 @@ SkGrPixelRef::SkGrPixelRef(GrSurface* surface, bool transferCacheLock) {
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();