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

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

Issue 582963002: Solo gp (Closed) Base URL: https://skia.googlesource.com/skia.git@no_peb
Patch Set: rebase Created 6 years, 2 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 "SkColorShader.h" 9 #include "SkColorShader.h"
10 #include "SkEmptyShader.h" 10 #include "SkEmptyShader.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 ////////////////////////////////////////////////////////////////////////////// 216 //////////////////////////////////////////////////////////////////////////////
217 217
218 SkShader::BitmapType SkShader::asABitmap(SkBitmap*, SkMatrix*, TileMode*) const { 218 SkShader::BitmapType SkShader::asABitmap(SkBitmap*, SkMatrix*, TileMode*) const {
219 return kNone_BitmapType; 219 return kNone_BitmapType;
220 } 220 }
221 221
222 SkShader::GradientType SkShader::asAGradient(GradientInfo* info) const { 222 SkShader::GradientType SkShader::asAGradient(GradientInfo* info) const {
223 return kNone_GradientType; 223 return kNone_GradientType;
224 } 224 }
225 225
226 bool SkShader::asNewEffect(GrContext* context, const SkPaint& paint, 226 bool SkShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix*, GrColor*,
227 const SkMatrix* localMatrixOrNull, GrColor* paintColo r, 227 GrFragmentProcessor**) const {
228 GrEffect** effect) const {
229 return false; 228 return false;
230 } 229 }
231 230
232 SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const { 231 SkShader* SkShader::refAsALocalMatrixShader(SkMatrix*) const {
233 return NULL; 232 return NULL;
234 } 233 }
235 234
236 SkShader* SkShader::CreateEmptyShader() { 235 SkShader* SkShader::CreateEmptyShader() {
237 return SkNEW(SkEmptyShader); 236 return SkNEW(SkEmptyShader);
238 } 237 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 info->fColorCount = 1; 362 info->fColorCount = 1;
364 info->fTileMode = SkShader::kRepeat_TileMode; 363 info->fTileMode = SkShader::kRepeat_TileMode;
365 } 364 }
366 return kColor_GradientType; 365 return kColor_GradientType;
367 } 366 }
368 367
369 #if SK_SUPPORT_GPU 368 #if SK_SUPPORT_GPU
370 369
371 #include "SkGr.h" 370 #include "SkGr.h"
372 371
373 bool SkColorShader::asNewEffect(GrContext* context, const SkPaint& paint, 372 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint& paint, const SkMatrix*,
374 const SkMatrix* localMatrix, GrColor* paintColor , 373 GrColor* paintColor, GrFragmentProcessor ** fp) const {
375 GrEffect** effect) const { 374 *fp = NULL;
376 *effect = NULL;
377 SkColor skColor = fColor; 375 SkColor skColor = fColor;
378 U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha()); 376 U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha());
379 *paintColor = SkColor2GrColor(SkColorSetA(skColor, newA)); 377 *paintColor = SkColor2GrColor(SkColorSetA(skColor, newA));
380 return true; 378 return true;
381 } 379 }
382 380
383 #else 381 #else
384 382
385 bool SkColorShader::asNewEffect(GrContext* context, const SkPaint& paint, 383 bool SkColorShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMatr ix*, GrColor*,
386 const SkMatrix* localMatrix, GrColor* paint Color, 384 GrFragmentProcessor**) const {
387 GrEffect** effect) const {
388 SkDEBUGFAIL("Should not call in GPU-less build"); 385 SkDEBUGFAIL("Should not call in GPU-less build");
389 return false; 386 return false;
390 } 387 }
391 388
392 #endif 389 #endif
393 390
394 #ifndef SK_IGNORE_TO_STRING 391 #ifndef SK_IGNORE_TO_STRING
395 void SkColorShader::toString(SkString* str) const { 392 void SkColorShader::toString(SkString* str) const {
396 str->append("SkColorShader: ("); 393 str->append("SkColorShader: (");
397 394
(...skipping 16 matching lines...) Expand all
414 #include "SkEmptyShader.h" 411 #include "SkEmptyShader.h"
415 412
416 void SkEmptyShader::toString(SkString* str) const { 413 void SkEmptyShader::toString(SkString* str) const {
417 str->append("SkEmptyShader: ("); 414 str->append("SkEmptyShader: (");
418 415
419 this->INHERITED::toString(str); 416 this->INHERITED::toString(str);
420 417
421 str->append(")"); 418 str->append(")");
422 } 419 }
423 #endif 420 #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