OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
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 #include "SkGr.h" | 8 #include "SkGr.h" |
9 | 9 |
10 #include "GrXferProcessor.h" | 10 #include "GrXferProcessor.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 namespace { | 157 namespace { |
158 | 158 |
159 // When the SkPixelRef genID changes, invalidate a corresponding GrResource desc
ribed by key. | 159 // When the SkPixelRef genID changes, invalidate a corresponding GrResource desc
ribed by key. |
160 class BitmapInvalidator : public SkPixelRef::GenIDChangeListener { | 160 class BitmapInvalidator : public SkPixelRef::GenIDChangeListener { |
161 public: | 161 public: |
162 explicit BitmapInvalidator(const GrUniqueKey& key) : fMsg(key) {} | 162 explicit BitmapInvalidator(const GrUniqueKey& key) : fMsg(key) {} |
163 private: | 163 private: |
164 GrUniqueKeyInvalidatedMessage fMsg; | 164 GrUniqueKeyInvalidatedMessage fMsg; |
165 | 165 |
166 void onChange() SK_OVERRIDE { | 166 void onChange() override { |
167 SkMessageBus<GrUniqueKeyInvalidatedMessage>::Post(fMsg); | 167 SkMessageBus<GrUniqueKeyInvalidatedMessage>::Post(fMsg); |
168 } | 168 } |
169 }; | 169 }; |
170 | 170 |
171 } // namespace | 171 } // namespace |
172 | 172 |
173 | 173 |
174 static GrTexture* create_texture_for_bmp(GrContext* ctx, | 174 static GrTexture* create_texture_for_bmp(GrContext* ctx, |
175 const GrUniqueKey& optionalKey, | 175 const GrUniqueKey& optionalKey, |
176 GrSurfaceDesc desc, | 176 GrSurfaceDesc desc, |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol
or, &fp) && fp) { | 722 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol
or, &fp) && fp) { |
723 grPaint->addColorProcessor(fp)->unref(); | 723 grPaint->addColorProcessor(fp)->unref(); |
724 constantColor = false; | 724 constantColor = false; |
725 } | 725 } |
726 } | 726 } |
727 | 727 |
728 // The grcolor is automatically set when calling asFragmentProcessor. | 728 // The grcolor is automatically set when calling asFragmentProcessor. |
729 // If the shader can be seen as an effect it returns true and adds its effec
t to the grpaint. | 729 // If the shader can be seen as an effect it returns true and adds its effec
t to the grpaint. |
730 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP
aint); | 730 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP
aint); |
731 } | 731 } |
OLD | NEW |