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

Side by Side Diff: src/core/SkColorShader.h

Issue 1287263005: change asABitmap to isABitmap on shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2007 The Android Open Source Project 2 * Copyright 2007 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkColorShader_DEFINED 8 #ifndef SkColorShader_DEFINED
9 #define SkColorShader_DEFINED 9 #define SkColorShader_DEFINED
10 10
(...skipping 29 matching lines...) Expand all
40 void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) override; 40 void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) override;
41 41
42 private: 42 private:
43 SkPMColor fPMColor; 43 SkPMColor fPMColor;
44 uint32_t fFlags; 44 uint32_t fFlags;
45 uint16_t fColor16; 45 uint16_t fColor16;
46 46
47 typedef SkShader::Context INHERITED; 47 typedef SkShader::Context INHERITED;
48 }; 48 };
49 49
50 // we return false for this, use asAGradient
51 virtual BitmapType asABitmap(SkBitmap* outTexture,
52 SkMatrix* outMatrix,
53 TileMode xy[2]) const override;
54
55 GradientType asAGradient(GradientInfo* info) const override; 50 GradientType asAGradient(GradientInfo* info) const override;
56 51
57 bool asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix& viewM, 52 bool asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix& viewM,
58 const SkMatrix*, GrColor*, GrProcessorDataManager*, 53 const SkMatrix*, GrColor*, GrProcessorDataManager*,
59 GrFragmentProcessor**) const override; 54 GrFragmentProcessor**) const override;
60 55
61 SK_TO_STRING_OVERRIDE() 56 SK_TO_STRING_OVERRIDE()
62 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader) 57 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorShader)
63 58
64 protected: 59 protected:
65 SkColorShader(SkReadBuffer&); 60 SkColorShader(SkReadBuffer&);
66 void flatten(SkWriteBuffer&) const override; 61 void flatten(SkWriteBuffer&) const override;
67 Context* onCreateContext(const ContextRec&, void* storage) const override; 62 Context* onCreateContext(const ContextRec&, void* storage) const override;
68 bool onAsLuminanceColor(SkColor* lum) const override { 63 bool onAsLuminanceColor(SkColor* lum) const override {
69 *lum = fColor; 64 *lum = fColor;
70 return true; 65 return true;
71 } 66 }
72 67
73 private: 68 private:
74 SkColor fColor; 69 SkColor fColor;
75 70
76 typedef SkShader INHERITED; 71 typedef SkShader INHERITED;
77 }; 72 };
78 73
79 #endif 74 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698