OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkPDFShader.h" | 10 #include "SkPDFShader.h" |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 if (tileModes[0] == SkShader::kMirror_TileMode) { | 1103 if (tileModes[0] == SkShader::kMirror_TileMode) { |
1104 bottomMatrix.postScale(-1, 1); | 1104 bottomMatrix.postScale(-1, 1); |
1105 bottomMatrix.postTranslate(2 * width, 0); | 1105 bottomMatrix.postTranslate(2 * width, 0); |
1106 drawBitmapMatrix(&canvas, bottom, bottomMatrix); | 1106 drawBitmapMatrix(&canvas, bottom, bottomMatrix); |
1107 } | 1107 } |
1108 patternBBox.fBottom = deviceBounds.height(); | 1108 patternBBox.fBottom = deviceBounds.height(); |
1109 } | 1109 } |
1110 } | 1110 } |
1111 | 1111 |
1112 // Put the canvas into the pattern stream (fContent). | 1112 // Put the canvas into the pattern stream (fContent). |
1113 SkAutoTDelete<SkStream> content(patternDevice->content()); | 1113 SkAutoTDelete<SkStreamAsset> content(patternDevice->content()); |
1114 | 1114 |
1115 SkPDFImageShader* imageShader = | 1115 SkPDFImageShader* imageShader = |
1116 SkNEW_ARGS(SkPDFImageShader, (canon, autoState->detach())); | 1116 SkNEW_ARGS(SkPDFImageShader, (canon, autoState->detach())); |
1117 imageShader->setData(content.get()); | 1117 imageShader->setData(content.get()); |
1118 | 1118 |
1119 populate_tiling_pattern_dict(imageShader, patternBBox, | 1119 populate_tiling_pattern_dict(imageShader, patternBBox, |
1120 patternDevice->getResourceDict(), finalMatrix); | 1120 patternDevice->getResourceDict(), finalMatrix); |
1121 | 1121 |
1122 imageShader->fShaderState->fImage.unlockPixels(); | 1122 imageShader->fShaderState->fImage.unlockPixels(); |
1123 | 1123 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 return false; | 1317 return false; |
1318 } | 1318 } |
1319 | 1319 |
1320 void SkPDFShader::State::AllocateGradientInfoStorage() { | 1320 void SkPDFShader::State::AllocateGradientInfoStorage() { |
1321 fColorData.set(sk_malloc_throw( | 1321 fColorData.set(sk_malloc_throw( |
1322 fInfo.fColorCount * (sizeof(SkColor) + sizeof(SkScalar)))); | 1322 fInfo.fColorCount * (sizeof(SkColor) + sizeof(SkScalar)))); |
1323 fInfo.fColors = reinterpret_cast<SkColor*>(fColorData.get()); | 1323 fInfo.fColors = reinterpret_cast<SkColor*>(fColorData.get()); |
1324 fInfo.fColorOffsets = | 1324 fInfo.fColorOffsets = |
1325 reinterpret_cast<SkScalar*>(fInfo.fColors + fInfo.fColorCount); | 1325 reinterpret_cast<SkScalar*>(fInfo.fColors + fInfo.fColorCount); |
1326 } | 1326 } |
OLD | NEW |