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

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

Issue 846023003: In SkPDFDocument::emitPDF(), stop pre-calculating file offsets. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit: space between functions Created 5 years, 11 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/SkPDFGraphicState.h ('k') | src/pdf/SkPDFPage.h » ('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 2011 Google Inc. 2 * Copyright 2011 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 "SkData.h" 8 #include "SkData.h"
9 #include "SkPDFFormXObject.h" 9 #include "SkPDFFormXObject.h"
10 #include "SkPDFGraphicState.h" 10 #include "SkPDFGraphicState.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 SkTSet<SkPDFObject*>* newResourceObjects) { 68 SkTSet<SkPDFObject*>* newResourceObjects) {
69 GetResourcesHelper(&fResources, knownResourceObjects, newResourceObjects); 69 GetResourcesHelper(&fResources, knownResourceObjects, newResourceObjects);
70 } 70 }
71 71
72 void SkPDFGraphicState::emitObject(SkWStream* stream, SkPDFCatalog* catalog) { 72 void SkPDFGraphicState::emitObject(SkWStream* stream, SkPDFCatalog* catalog) {
73 populateDict(); 73 populateDict();
74 SkPDFDict::emitObject(stream, catalog); 74 SkPDFDict::emitObject(stream, catalog);
75 } 75 }
76 76
77 // static 77 // static
78 size_t SkPDFGraphicState::getOutputSize(SkPDFCatalog* catalog, bool indirect) {
79 populateDict();
80 return SkPDFDict::getOutputSize(catalog, indirect);
81 }
82
83 // static
84 SkTDArray<SkPDFGraphicState::GSCanonicalEntry>& SkPDFGraphicState::CanonicalPain ts() { 78 SkTDArray<SkPDFGraphicState::GSCanonicalEntry>& SkPDFGraphicState::CanonicalPain ts() {
85 CanonicalPaintsMutex().assertHeld(); 79 CanonicalPaintsMutex().assertHeld();
86 static SkTDArray<SkPDFGraphicState::GSCanonicalEntry> gCanonicalPaints; 80 static SkTDArray<SkPDFGraphicState::GSCanonicalEntry> gCanonicalPaints;
87 return gCanonicalPaints; 81 return gCanonicalPaints;
88 } 82 }
89 83
90 SK_DECLARE_STATIC_MUTEX(gCanonicalPaintsMutex); 84 SK_DECLARE_STATIC_MUTEX(gCanonicalPaintsMutex);
91 // static 85 // static
92 SkBaseMutex& SkPDFGraphicState::CanonicalPaintsMutex() { 86 SkBaseMutex& SkPDFGraphicState::CanonicalPaintsMutex() {
93 return gCanonicalPaintsMutex; 87 return gCanonicalPaintsMutex;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 } 271 }
278 if (bXfermodeName < 0 || bXfermodeName > SkXfermode::kLastMode || 272 if (bXfermodeName < 0 || bXfermodeName > SkXfermode::kLastMode ||
279 blend_mode_from_xfermode(bXfermodeName) == NULL) { 273 blend_mode_from_xfermode(bXfermodeName) == NULL) {
280 bXfermodeName = SkXfermode::kSrcOver_Mode; 274 bXfermodeName = SkXfermode::kSrcOver_Mode;
281 } 275 }
282 const char* bXfermodeString = blend_mode_from_xfermode(bXfermodeName); 276 const char* bXfermodeString = blend_mode_from_xfermode(bXfermodeName);
283 SkASSERT(bXfermodeString != NULL); 277 SkASSERT(bXfermodeString != NULL);
284 278
285 return strcmp(aXfermodeString, bXfermodeString) == 0; 279 return strcmp(aXfermodeString, bXfermodeString) == 0;
286 } 280 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFGraphicState.h ('k') | src/pdf/SkPDFPage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698