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

Unified Diff: include/core/SkColorShader.h

Issue 492963002: extend SkShader to report a luminance-color to be used for gamma correction (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase, add SkShader::CreateColorShader(c) Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/core/SkColorShader.h
diff --git a/include/core/SkColorShader.h b/include/core/SkColorShader.h
index 4ff7d2b01d375b64659c1db2a81e3e59bb4c84d7..55d980b64e38909e4122645fd622c5713f7b8a73 100644
--- a/include/core/SkColorShader.h
+++ b/include/core/SkColorShader.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2007 The Android Open Source Project
*
@@ -6,7 +5,6 @@
* found in the LICENSE file.
*/
-
#ifndef SkColorShader_DEFINED
#define SkColorShader_DEFINED
@@ -67,9 +65,13 @@ protected:
SkColorShader(SkReadBuffer&);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE;
+ virtual bool onAsLuminanceColor(SkColor* lum) const SK_OVERRIDE {
+ *lum = fColor;
+ return true;
+ }
private:
- SkColor fColor; // ignored if fInheritColor is true
+ SkColor fColor;
typedef SkShader INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698