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

Side by Side Diff: src/pdf/SkPDFShader.cpp

Issue 958433003: SkPDF: replace SkPDFDevice::copyContentToData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « src/pdf/SkPDFPage.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFPage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698