Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / include / core / SkPixelRef.h
index e65f4a0..8319ec6 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * Copyright 2008 The Android Open Source Project
  *
@@ -6,7 +5,6 @@
  * found in the LICENSE file.
  */
 
-
 #ifndef SkPixelRef_DEFINED
 #define SkPixelRef_DEFINED
 
@@ -128,12 +126,20 @@ public:
     */
     uint32_t getGenerationID() const;
 
-    /** Call this if you have changed the contents of the pixels. This will in-
-        turn cause a different generation ID value to be returned from
-        getGenerationID().
-    */
+    /**
+     *  Call this if you have changed the contents of the pixels. This will in-
+     *  turn cause a different generation ID value to be returned from
+     *  getGenerationID().
+     */
     void notifyPixelsChanged();
 
+    /**
+     *  Change the info's AlphaType. Note that this does not automatically
+     *  invalidate the generation ID. If the pixel values themselves have
+     *  changed, then you must explicitly call notifyPixelsChanged() as well.
+     */
+    void changeAlphaType(SkAlphaType at);
+
     /** Returns true if this pixelref is marked as immutable, meaning that the
         contents of its pixels will not change for the lifetime of the pixelref.
     */
@@ -263,10 +269,6 @@ public:
     void addGenIDChangeListener(GenIDChangeListener* listener);
 
 protected:
-#ifdef SK_SUPPORT_LEGACY_ONLOCKPIXELS
-    virtual void* onLockPixels(SkColorTable**);
-    virtual bool onNewLockPixels(LockRec*);
-#else
     /**
      *  On success, returns true and fills out the LockRec for the pixels. On
      *  failure returns false and ignores the LockRec parameter.
@@ -275,7 +277,6 @@ protected:
      *  method need not do that.
      */
     virtual bool onNewLockPixels(LockRec*) = 0;
-#endif
 
     /**
      *  Balancing the previous successful call to onNewLockPixels. The locked
@@ -322,8 +323,8 @@ protected:
     SkBaseMutex* mutex() const { return fMutex; }
 
     // serialization
-    SkPixelRef(SkFlattenableReadBuffer&, SkBaseMutex*);
-    virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
+    SkPixelRef(SkReadBuffer&, SkBaseMutex*);
+    virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
 
     // only call from constructor. Flags this to always be locked, removing
     // the need to grab the mutex and call onLockPixels/onUnlockPixels.
@@ -333,6 +334,7 @@ protected:
 private:
     SkBaseMutex*    fMutex; // must remain in scope for the life of this object
 
+    // mostly const. fInfo.fAlpahType can be changed at runtime.
     const SkImageInfo fInfo;
 
     // LockRec is only valid if we're in a locked state (isLocked())