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

Side by Side Diff: src/core/SkShader.cpp

Issue 374923002: Goodbye GrEffectRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@noref3
Patch Set: Address comments Created 6 years, 5 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
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 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 #include "SkBitmapProcShader.h" 8 #include "SkBitmapProcShader.h"
9 #include "SkEmptyShader.h" 9 #include "SkEmptyShader.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 SkShader::BitmapType SkShader::asABitmap(SkBitmap*, SkMatrix*, TileMode*) const { 203 SkShader::BitmapType SkShader::asABitmap(SkBitmap*, SkMatrix*, TileMode*) const {
204 return kNone_BitmapType; 204 return kNone_BitmapType;
205 } 205 }
206 206
207 SkShader::GradientType SkShader::asAGradient(GradientInfo* info) const { 207 SkShader::GradientType SkShader::asAGradient(GradientInfo* info) const {
208 return kNone_GradientType; 208 return kNone_GradientType;
209 } 209 }
210 210
211 bool SkShader::asNewEffect(GrContext* context, const SkPaint& paint, 211 bool SkShader::asNewEffect(GrContext* context, const SkPaint& paint,
212 const SkMatrix* localMatrixOrNull, GrColor* grColor, 212 const SkMatrix* localMatrixOrNull, GrColor* paintColo r,
213 GrEffect** grEffect) const { 213 GrEffect** effect) const {
214 return false; 214 return false;
215 } 215 }
216 216
217 SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const { 217 SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const {
218 return NULL; 218 return NULL;
219 } 219 }
220 220
221 SkShader* SkShader::CreateEmptyShader() { 221 SkShader* SkShader::CreateEmptyShader() {
222 return SkNEW(SkEmptyShader); 222 return SkNEW(SkEmptyShader);
223 } 223 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 info->fTileMode = SkShader::kRepeat_TileMode; 341 info->fTileMode = SkShader::kRepeat_TileMode;
342 } 342 }
343 return kColor_GradientType; 343 return kColor_GradientType;
344 } 344 }
345 345
346 #if SK_SUPPORT_GPU 346 #if SK_SUPPORT_GPU
347 347
348 #include "SkGr.h" 348 #include "SkGr.h"
349 349
350 bool SkColorShader::asNewEffect(GrContext* context, const SkPaint& paint, 350 bool SkColorShader::asNewEffect(GrContext* context, const SkPaint& paint,
351 const SkMatrix* localMatrix, GrColor* grColor, 351 const SkMatrix* localMatrix, GrColor* paintColor ,
352 GrEffectRef** grEffect) const { 352 GrEffect** effect) const {
353 *grEffect = NULL; 353 *effect = NULL;
354 SkColor skColor = fColor; 354 SkColor skColor = fColor;
355 U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha()); 355 U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha());
356 *grColor = SkColor2GrColor(SkColorSetA(skColor, newA)); 356 *paintColor = SkColor2GrColor(SkColorSetA(skColor, newA));
357 return true; 357 return true;
358 } 358 }
359 359
360 #else 360 #else
361 361
362 bool SkColorShader::asNewEffect(GrContext* context, const SkPaint& paint, 362 bool SkColorShader::asNewEffect(GrContext* context, const SkPaint& paint,
363 const SkMatrix* localMatrix, GrColor* grCol or, 363 const SkMatrix* localMatrix, GrColor* paint Color,
364 GrEffect** grEffect) const { 364 GrEffect** effect) const {
365 SkDEBUGFAIL("Should not call in GPU-less build"); 365 SkDEBUGFAIL("Should not call in GPU-less build");
366 return false; 366 return false;
367 } 367 }
368 368
369 #endif 369 #endif
370 370
371 #ifndef SK_IGNORE_TO_STRING 371 #ifndef SK_IGNORE_TO_STRING
372 void SkColorShader::toString(SkString* str) const { 372 void SkColorShader::toString(SkString* str) const {
373 str->append("SkColorShader: ("); 373 str->append("SkColorShader: (");
374 374
(...skipping 12 matching lines...) Expand all
387 #include "SkEmptyShader.h" 387 #include "SkEmptyShader.h"
388 388
389 void SkEmptyShader::toString(SkString* str) const { 389 void SkEmptyShader::toString(SkString* str) const {
390 str->append("SkEmptyShader: ("); 390 str->append("SkEmptyShader: (");
391 391
392 this->INHERITED::toString(str); 392 this->INHERITED::toString(str);
393 393
394 str->append(")"); 394 str->append(")");
395 } 395 }
396 #endif 396 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698