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

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

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 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 "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkBitmapProcShader.h" 9 #include "SkBitmapProcShader.h"
10 #include "SkColorShader.h" 10 #include "SkColorShader.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 318 }
319 319
320 void SkColorShader::ColorShaderContext::shadeSpan16(int x, int y, uint16_t span[ ], int count) { 320 void SkColorShader::ColorShaderContext::shadeSpan16(int x, int y, uint16_t span[ ], int count) {
321 sk_memset16(span, fColor16, count); 321 sk_memset16(span, fColor16, count);
322 } 322 }
323 323
324 void SkColorShader::ColorShaderContext::shadeSpanAlpha(int x, int y, uint8_t alp ha[], int count) { 324 void SkColorShader::ColorShaderContext::shadeSpanAlpha(int x, int y, uint8_t alp ha[], int count) {
325 memset(alpha, SkGetPackedA32(fPMColor), count); 325 memset(alpha, SkGetPackedA32(fPMColor), count);
326 } 326 }
327 327
328 // if we had a asAColor method, that would be more efficient...
329 SkShader::BitmapType SkColorShader::asABitmap(SkBitmap* bitmap, SkMatrix* matrix ,
330 TileMode modes[]) const {
331 return kNone_BitmapType;
332 }
333
334 SkShader::GradientType SkColorShader::asAGradient(GradientInfo* info) const { 328 SkShader::GradientType SkColorShader::asAGradient(GradientInfo* info) const {
335 if (info) { 329 if (info) {
336 if (info->fColors && info->fColorCount >= 1) { 330 if (info->fColors && info->fColorCount >= 1) {
337 info->fColors[0] = fColor; 331 info->fColors[0] = fColor;
338 } 332 }
339 info->fColorCount = 1; 333 info->fColorCount = 1;
340 info->fTileMode = SkShader::kRepeat_TileMode; 334 info->fTileMode = SkShader::kRepeat_TileMode;
341 } 335 }
342 return kColor_GradientType; 336 return kColor_GradientType;
343 } 337 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 #include "SkEmptyShader.h" 384 #include "SkEmptyShader.h"
391 385
392 void SkEmptyShader::toString(SkString* str) const { 386 void SkEmptyShader::toString(SkString* str) const {
393 str->append("SkEmptyShader: ("); 387 str->append("SkEmptyShader: (");
394 388
395 this->INHERITED::toString(str); 389 this->INHERITED::toString(str);
396 390
397 str->append(")"); 391 str->append(")");
398 } 392 }
399 #endif 393 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698