OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkPerlinNoiseShader.h" | 8 #include "SkPerlinNoiseShader.h" |
9 #include "SkColorFilter.h" | 9 #include "SkColorFilter.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 calculateTurbulenceValueForPoint(channel, stitchData, newPoint)); | 427 calculateTurbulenceValueForPoint(channel, stitchData, newPoint)); |
428 } | 428 } |
429 return SkPreMultiplyARGB(rgba[3], rgba[0], rgba[1], rgba[2]); | 429 return SkPreMultiplyARGB(rgba[3], rgba[0], rgba[1], rgba[2]); |
430 } | 430 } |
431 | 431 |
432 SkShader::Context* SkPerlinNoiseShader::onCreateContext(const ContextRec& rec, | 432 SkShader::Context* SkPerlinNoiseShader::onCreateContext(const ContextRec& rec, |
433 void* storage) const { | 433 void* storage) const { |
434 return new (storage) PerlinNoiseShaderContext(*this, rec); | 434 return new (storage) PerlinNoiseShaderContext(*this, rec); |
435 } | 435 } |
436 | 436 |
437 size_t SkPerlinNoiseShader::contextSize() const { | 437 size_t SkPerlinNoiseShader::contextSize(const ContextRec&) const { |
438 return sizeof(PerlinNoiseShaderContext); | 438 return sizeof(PerlinNoiseShaderContext); |
439 } | 439 } |
440 | 440 |
441 SkPerlinNoiseShader::PerlinNoiseShaderContext::PerlinNoiseShaderContext( | 441 SkPerlinNoiseShader::PerlinNoiseShaderContext::PerlinNoiseShaderContext( |
442 const SkPerlinNoiseShader& shader, const ContextRec& rec) | 442 const SkPerlinNoiseShader& shader, const ContextRec& rec) |
443 : INHERITED(shader, rec) | 443 : INHERITED(shader, rec) |
444 { | 444 { |
445 SkMatrix newMatrix = *rec.fMatrix; | 445 SkMatrix newMatrix = *rec.fMatrix; |
446 newMatrix.preConcat(shader.getLocalMatrix()); | 446 newMatrix.preConcat(shader.getLocalMatrix()); |
447 if (rec.fLocalMatrix) { | 447 if (rec.fLocalMatrix) { |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 str->append(" seed: "); | 970 str->append(" seed: "); |
971 str->appendScalar(fSeed); | 971 str->appendScalar(fSeed); |
972 str->append(" stitch tiles: "); | 972 str->append(" stitch tiles: "); |
973 str->append(fStitchTiles ? "true " : "false "); | 973 str->append(fStitchTiles ? "true " : "false "); |
974 | 974 |
975 this->INHERITED::toString(str); | 975 this->INHERITED::toString(str); |
976 | 976 |
977 str->append(")"); | 977 str->append(")"); |
978 } | 978 } |
979 #endif | 979 #endif |
OLD | NEW |