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 "SkDither.h" | 8 #include "SkDither.h" |
9 #include "SkPerlinNoiseShader2.h" | 9 #include "SkPerlinNoiseShader2.h" |
10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 rgba[channel] = SkScalarFloorToInt(255 * value); | 564 rgba[channel] = SkScalarFloorToInt(255 * value); |
565 } | 565 } |
566 return SkPreMultiplyARGB(rgba[3], rgba[0], rgba[1], rgba[2]); | 566 return SkPreMultiplyARGB(rgba[3], rgba[0], rgba[1], rgba[2]); |
567 } | 567 } |
568 | 568 |
569 SkShader::Context* SkPerlinNoiseShader2::onCreateContext(const ContextRec& rec, | 569 SkShader::Context* SkPerlinNoiseShader2::onCreateContext(const ContextRec& rec, |
570 void* storage) const { | 570 void* storage) const { |
571 return new (storage) PerlinNoiseShaderContext(*this, rec); | 571 return new (storage) PerlinNoiseShaderContext(*this, rec); |
572 } | 572 } |
573 | 573 |
574 size_t SkPerlinNoiseShader2::contextSize() const { | 574 size_t SkPerlinNoiseShader2::contextSize(const ContextRec&) const { |
575 return sizeof(PerlinNoiseShaderContext); | 575 return sizeof(PerlinNoiseShaderContext); |
576 } | 576 } |
577 | 577 |
578 SkPerlinNoiseShader2::PerlinNoiseShaderContext::PerlinNoiseShaderContext( | 578 SkPerlinNoiseShader2::PerlinNoiseShaderContext::PerlinNoiseShaderContext( |
579 const SkPerlinNoiseShader2& shader, const ContextRec& rec) | 579 const SkPerlinNoiseShader2& shader, const ContextRec& rec) |
580 : INHERITED(shader, rec) | 580 : INHERITED(shader, rec) |
581 { | 581 { |
582 SkMatrix newMatrix = *rec.fMatrix; | 582 SkMatrix newMatrix = *rec.fMatrix; |
583 newMatrix.preConcat(shader.getLocalMatrix()); | 583 newMatrix.preConcat(shader.getLocalMatrix()); |
584 if (rec.fLocalMatrix) { | 584 if (rec.fLocalMatrix) { |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1393 str->append(" seed: "); | 1393 str->append(" seed: "); |
1394 str->appendScalar(fSeed); | 1394 str->appendScalar(fSeed); |
1395 str->append(" stitch tiles: "); | 1395 str->append(" stitch tiles: "); |
1396 str->append(fStitchTiles ? "true " : "false "); | 1396 str->append(fStitchTiles ? "true " : "false "); |
1397 | 1397 |
1398 this->INHERITED::toString(str); | 1398 this->INHERITED::toString(str); |
1399 | 1399 |
1400 str->append(")"); | 1400 str->append(")"); |
1401 } | 1401 } |
1402 #endif | 1402 #endif |
OLD | NEW |