GPU device preserves pixel values across read/write/read of unpremul pixel values

Review URL: http://codereview.appspot.com/5695047/



git-svn-id: http://skia.googlecode.com/svn/trunk@3237 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index eac8d4f..398a2fc 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -46,6 +46,8 @@
                                     size_t rowBytes) const SK_OVERRIDE;
     virtual bool fullReadPixelsIsFasterThanPartial() const SK_OVERRIDE;
 
+    virtual bool canPreserveReadWriteUnpremulPixels() SK_OVERRIDE;
+
 protected:
     GrGpuGL(const GrGLContextInfo& ctxInfo);
 
@@ -62,6 +64,11 @@
         bool fSmoothLineEnabled;
     } fHWAAState;
 
+    enum UnpremulConversion {
+        kUpOnWrite_DownOnRead_UnpremulConversion,
+        kDownOnWrite_UpOnRead_UnpremulConversion
+    } fUnpremulConversion;
+
     GrDrawState fHWDrawState;
     bool        fHWStencilClip;
 
@@ -246,6 +253,11 @@
     // from our loop that tries stencil formats and calls check fb status.
     int fLastSuccessfulStencilFmtIdx;
 
+    enum CanPreserveUnpremulRoundtrip {
+        kUnknown_CanPreserveUnpremulRoundtrip,
+        kNo_CanPreserveUnpremulRoundtrip,
+        kYes_CanPreserveUnpremulRoundtrip,
+    } fCanPreserveUnpremulRoundtrip;
 
     bool fPrintedCaps;