Revert of Fix compilation error when building with clang on Linux. (https://coderevie...
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 22 May 2014 03:20:47 +0000 (03:20 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 22 May 2014 03:20:47 +0000 (03:20 +0000)
Reason for revert:
need to revert this along with reverting the big unitmapper cl

Original issue's description:
> Fix compilation error when building with clang on Linux.
>
> ../../src/effects/gradients/SkGradientShader.cpp:487:22: error: unused
> function 'bitsTo16' [-Werror,-Wunused-function]
> static inline U16CPU bitsTo16(unsigned x, const unsigned bits) {
>
> R=bsalomon@google.com
> TEST=make tests
>
> Committed: http://code.google.com/p/skia/source/detail?r=14835

R=bsalomon@google.com, reed@google.com, tfarina@chromium.org
TBR=bsalomon@google.com, reed@google.com, tfarina@chromium.org
NOTREECHECKS=true
NOTRY=true

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/297803010

git-svn-id: http://skia.googlecode.com/svn/trunk@14839 2bbb7eff-a529-9590-31e7-b0007b416f81

src/effects/gradients/SkGradientShader.cpp

index e43a0264de67566ca178593c8be09972fc9d3dab..d376b2223696d45569d8389dda073ec90e3f1921 100644 (file)
@@ -485,6 +485,18 @@ static inline int SkFixedToFFFF(SkFixed x) {
     return x - (x >> 16);
 }
 
+static inline U16CPU bitsTo16(unsigned x, const unsigned bits) {
+    SkASSERT(x < (1U << bits));
+    if (6 == bits) {
+        return (x << 10) | (x << 4) | (x >> 2);
+    }
+    if (8 == bits) {
+        return (x << 8) | x;
+    }
+    sk_throw();
+    return 0;
+}
+
 const uint16_t* SkGradientShaderBase::GradientShaderCache::getCache16() {
     SkOnce(&fCache16Inited, &fCache16Mutex, SkGradientShaderBase::GradientShaderCache::initCache16,
            this);