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

Issue 513423002: Revert of Revert of Revert of add gamma/sRGB to SkImageInfo (Closed)

Created:
6 years, 3 months ago by reed1
Modified:
6 years, 3 months ago
Reviewers:
bungeman-skia, bsalomon
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Revert of Revert of Revert of add gamma/sRGB to SkImageInfo (patchset #1 of https://codereview.chromium.org/511363002/) Reason for revert: android builder in chrome reveals the caller using { } initialization for SkImageInfo, which this CL now makes illegal. Will have to fix the call site before I can re-land this. Original issue's description: > Revert of Revert of add gamma/sRGB to SkImageInfo (patchset #1 of https://codereview.chromium.org/512243002/) > > Reason for revert: > this revert was premature -- the chrome canary I looked at is old, and newer ones were green. So trying again... > > Original issue's description: > > Revert of add gamma/sRGB to SkImageInfo (patchset #4 of https://codereview.chromium.org/514753002/) > > > > Reason for revert: > > breaks linker on chrome -- may need SK_API, but not sure. > > > > Original issue's description: > > > add gamma/sRGB to SkImageInfo > > > > > > BUG=skia: > > > > > > Committed: https://skia.googlesource.com/skia/+/615c369777258231054840a88cdb74c68c382485 > > > > TBR=bungeman@google.com,bsalomon@google.com > > NOTREECHECKS=true > > NOTRY=true > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/dc53701216c0e9f98eacf6c0cda769ebbd200b59 > > TBR=bungeman@google.com,bsalomon@google.com > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/e759a2662273fdf52ebbb3822229945eda317e46 TBR=bungeman@google.com,bsalomon@google.com NOTREECHECKS=true NOTRY=true BUG=skia:

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -240 lines) Patch
M gyp/tests.gypi View 1 chunk +0 lines, -1 line 0 comments Download
M include/core/SkImageInfo.h View 4 chunks +24 lines, -64 lines 0 comments Download
M src/core/SkImageInfo.cpp View 2 chunks +21 lines, -111 lines 0 comments Download
D tests/ImageInfoTest.cpp View 1 chunk +0 lines, -64 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
reed1
Created Revert of Revert of Revert of add gamma/sRGB to SkImageInfo
6 years, 3 months ago (2014-08-28 21:41:45 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/reed@google.com/513423002/1
6 years, 3 months ago (2014-08-28 21:42:20 UTC) #2
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 3 months ago (2014-08-28 21:42:21 UTC) #3
commit-bot: I haz the power
6 years, 3 months ago (2014-08-28 21:42:22 UTC) #4
Failed to apply patch for include/core/SkImageInfo.h:
While running git apply --index -p1;
  error: patch failed: include/core/SkImageInfo.h:136
  error: include/core/SkImageInfo.h: patch does not apply

Patch:       include/core/SkImageInfo.h
Index: include/core/SkImageInfo.h
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h
index
82d24753aa3cf7993835de57c16f9c256e4a510a..3d82dc805c7998084986878283da43ef9f35b7b8
100644
--- a/include/core/SkImageInfo.h
+++ b/include/core/SkImageInfo.h
@@ -136,69 +136,36 @@
  *  Describe an image's dimensions and pixel type.
  */
 struct SkImageInfo {
-public:
-    SkImageInfo() {}
-
     int         fWidth;
     int         fHeight;
     SkColorType fColorType;
     SkAlphaType fAlphaType;
 
-private:
-    enum Profile {
-        kUnknown_Profile,
-        kSRGB_Profile,
-        kExponential_Profile,
-    };
-    
-    uint32_t    fProfile;
-    float       fGamma;
-
-    SkImageInfo(int width, int height, SkColorType ct, SkAlphaType at, Profile
p, float g)
-        : fWidth(width)
-        , fHeight(height)
-        , fColorType(ct)
-        , fAlphaType(at)
-        , fProfile(p)
-        , fGamma(g)
-    {}
-
-public:
-    /*
-     *  Return an info with the specified attributes, tagged as sRGB. Note that
if the requested
-     *  color type does not make sense with sRGB (e.g. kAlpha_8) then the sRGB
request is ignored.
-     *
-     *  You can call isSRGB() on the returned info to determine if the request
was fulfilled.
-     */
-    static SkImageInfo MakeSRGB(int width, int height, SkColorType ct,
SkAlphaType at);
-    
-    /*
-     *  Return an info with the specified attributes, tagged with a specific
gamma.
-     *  Note that if the requested gamma is unsupported for the requested color
type, then the gamma
-     *  value will be set to 1.0 (the default).
-     *
-     *  You can call gamma() to query the resulting gamma value.
-     */
-    static SkImageInfo MakeWithGamma(int width, int height, SkColorType ct,
SkAlphaType at,
-                                     float gamma);
-    
     static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType
at) {
-        return MakeWithGamma(width, height, ct, at, 1);
+        SkImageInfo info = {
+            width, height, ct, at
+        };
+        return info;
     }
 
     /**
      *  Sets colortype to the native ARGB32 type.
      */
     static SkImageInfo MakeN32(int width, int height, SkAlphaType at) {
-        return SkImageInfo(width, height, kN32_SkColorType, at,
kExponential_Profile, 1);
+        SkImageInfo info = {
+            width, height, kN32_SkColorType, at
+        };
+        return info;
     }
 
     /**
      *  Sets colortype to the native ARGB32 type, and the alphatype to premul.
      */
     static SkImageInfo MakeN32Premul(int width, int height) {
-        return SkImageInfo(width, height, kN32_SkColorType,
kPremul_SkAlphaType,
-                           kExponential_Profile, 1);
+        SkImageInfo info = {
+            width, height, kN32_SkColorType, kPremul_SkAlphaType
+        };
+        return info;
     }
 
     /**
@@ -209,17 +176,24 @@
     }
 
     static SkImageInfo MakeA8(int width, int height) {
-        return SkImageInfo(width, height, kAlpha_8_SkColorType,
kPremul_SkAlphaType,
-                           kUnknown_Profile, 0);
+        SkImageInfo info = {
+            width, height, kAlpha_8_SkColorType, kPremul_SkAlphaType
+        };
+        return info;
     }
 
     static SkImageInfo MakeUnknown(int width, int height) {
-        return SkImageInfo(width, height, kUnknown_SkColorType,
kIgnore_SkAlphaType,
-                           kUnknown_Profile, 0);
+        SkImageInfo info = {
+            width, height, kUnknown_SkColorType, kIgnore_SkAlphaType
+        };
+        return info;
     }
 
     static SkImageInfo MakeUnknown() {
-        return SkImageInfo(0, 0, kUnknown_SkColorType, kIgnore_SkAlphaType,
kUnknown_Profile, 0);
+        SkImageInfo info = {
+            0, 0, kUnknown_SkColorType, kIgnore_SkAlphaType
+        };
+        return info;
     }
 
     int width() const { return fWidth; }
@@ -262,11 +236,8 @@
         return 0 != memcmp(this, &other, sizeof(other));
     }
 
-    // DEPRECATED : use the static Unflatten
     void unflatten(SkReadBuffer&);
     void flatten(SkWriteBuffer&) const;
-    
-    static SkImageInfo Unflatten(SkReadBuffer&);
 
     int64_t getSafeSize64(size_t rowBytes) const {
         if (0 == fHeight) {
@@ -285,17 +256,6 @@
     }
 
     SkDEBUGCODE(void validate() const;)
-
-    /**
-     *  If the Info was tagged to be sRGB, return true, else return false.
-     */
-    bool isSRGB() const { return kSRGB_Profile == fProfile; }
-    
-    /**
-     *  If this was tagged with an explicit gamma value, return that value,
else return 0.
-     *  If this was tagged as sRGB, return 0.
-     */
-    float gamma() const { return fGamma; }
 };
 
 #endif

Powered by Google App Engine
This is Rietveld 408576698