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

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

Issue 1788263002: SkPDF: remove all globally references SkPDFObjects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add explanatory comments Created 4 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/SkPDFCanon.h ('k') | src/pdf/SkPDFDevice.cpp » ('j') | 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 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "SkImage.h" 8 #include "SkImage.h"
9 #include "SkPDFBitmap.h" 9 #include "SkPDFBitmap.h"
10 #include "SkPDFCanon.h" 10 #include "SkPDFCanon.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 if (const SkImage** img = fBitmapToImageMap.find(key)) { 142 if (const SkImage** img = fBitmapToImageMap.find(key)) {
143 return *img; 143 return *img;
144 } 144 }
145 if (SkImage* image = SkImage::NewFromBitmap(bm)) { 145 if (SkImage* image = SkImage::NewFromBitmap(bm)) {
146 return *fBitmapToImageMap.set(key, image); 146 return *fBitmapToImageMap.set(key, image);
147 } 147 }
148 SkBitmap n32bitmap; // SkImage::NewFromBitmap can be finicky. 148 SkBitmap n32bitmap; // SkImage::NewFromBitmap can be finicky.
149 bm.copyTo(&n32bitmap, kN32_SkColorType); 149 bm.copyTo(&n32bitmap, kN32_SkColorType);
150 return *fBitmapToImageMap.set(key, SkImage::NewFromBitmap(n32bitmap)); 150 return *fBitmapToImageMap.set(key, SkImage::NewFromBitmap(n32bitmap));
151 } 151 }
152
153 sk_sp<SkPDFStream> SkPDFCanon::makeInvertFunction() {
154 if (fInvertFunction) {
155 return fInvertFunction;
156 }
157 fInvertFunction = SkPDFGraphicState::MakeInvertFunction();
158 return fInvertFunction;
159 }
160 sk_sp<SkPDFDict> SkPDFCanon::makeNoSmaskGraphicState() {
161 if (fNoSmaskGraphicState) {
162 return fNoSmaskGraphicState;
163 }
164 fNoSmaskGraphicState = SkPDFGraphicState::MakeNoSmaskGraphicState();
165 return fNoSmaskGraphicState;
166 }
167 sk_sp<SkPDFArray> SkPDFCanon::makeRangeObject() {
168 if (fRangeObject) {
169 return fRangeObject;
170 }
171 fRangeObject = SkPDFShader::MakeRangeObject();
172 return fRangeObject;
173 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFCanon.h ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698