| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkPictureShader.h" | 8 #include "SkPictureShader.h" |
| 9 | 9 |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 SkShader::Context::ShadeProc SkPictureShader::PictureShaderContext::asAShadeProc
(void** ctx) { | 283 SkShader::Context::ShadeProc SkPictureShader::PictureShaderContext::asAShadeProc
(void** ctx) { |
| 284 SkASSERT(fBitmapShaderContext); | 284 SkASSERT(fBitmapShaderContext); |
| 285 return fBitmapShaderContext->asAShadeProc(ctx); | 285 return fBitmapShaderContext->asAShadeProc(ctx); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void SkPictureShader::PictureShaderContext::shadeSpan(int x, int y, SkPMColor ds
tC[], int count) { | 288 void SkPictureShader::PictureShaderContext::shadeSpan(int x, int y, SkPMColor ds
tC[], int count) { |
| 289 SkASSERT(fBitmapShaderContext); | 289 SkASSERT(fBitmapShaderContext); |
| 290 fBitmapShaderContext->shadeSpan(x, y, dstC, count); | 290 fBitmapShaderContext->shadeSpan(x, y, dstC, count); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void SkPictureShader::PictureShaderContext::shadeSpan16(int x, int y, uint16_t d
stC[], int count) { | |
| 294 SkASSERT(fBitmapShaderContext); | |
| 295 fBitmapShaderContext->shadeSpan16(x, y, dstC, count); | |
| 296 } | |
| 297 | |
| 298 #ifndef SK_IGNORE_TO_STRING | 293 #ifndef SK_IGNORE_TO_STRING |
| 299 void SkPictureShader::toString(SkString* str) const { | 294 void SkPictureShader::toString(SkString* str) const { |
| 300 static const char* gTileModeName[SkShader::kTileModeCount] = { | 295 static const char* gTileModeName[SkShader::kTileModeCount] = { |
| 301 "clamp", "repeat", "mirror" | 296 "clamp", "repeat", "mirror" |
| 302 }; | 297 }; |
| 303 | 298 |
| 304 str->appendf("PictureShader: [%f:%f:%f:%f] ", | 299 str->appendf("PictureShader: [%f:%f:%f:%f] ", |
| 305 fPicture->cullRect().fLeft, | 300 fPicture->cullRect().fLeft, |
| 306 fPicture->cullRect().fTop, | 301 fPicture->cullRect().fTop, |
| 307 fPicture->cullRect().fRight, | 302 fPicture->cullRect().fRight, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 323 if (context) { | 318 if (context) { |
| 324 maxTextureSize = context->caps()->maxTextureSize(); | 319 maxTextureSize = context->caps()->maxTextureSize(); |
| 325 } | 320 } |
| 326 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(viewM, localMatrix
, maxTextureSize)); | 321 SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(viewM, localMatrix
, maxTextureSize)); |
| 327 if (!bitmapShader) { | 322 if (!bitmapShader) { |
| 328 return nullptr; | 323 return nullptr; |
| 329 } | 324 } |
| 330 return bitmapShader->asFragmentProcessor(context, viewM, nullptr, fq); | 325 return bitmapShader->asFragmentProcessor(context, viewM, nullptr, fq); |
| 331 } | 326 } |
| 332 #endif | 327 #endif |
| OLD | NEW |