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

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

Issue 920513003: Make filters use SkImage instead of SkBitmap 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/image/SkImage.cpp ('k') | src/utils/SkDeferredCanvas.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 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 "SkPDFDevice.h" 8 #include "SkPDFDevice.h"
9 9
10 #include "SkAnnotation.h" 10 #include "SkAnnotation.h"
11 #include "SkBitmapDevice.h" 11 #include "SkBitmapDevice.h"
12 #include "SkClipStack.h"
12 #include "SkColor.h" 13 #include "SkColor.h"
13 #include "SkClipStack.h"
14 #include "SkData.h" 14 #include "SkData.h"
15 #include "SkDraw.h" 15 #include "SkDraw.h"
16 #include "SkGlyphCache.h" 16 #include "SkGlyphCache.h"
17 #include "SkImage_Base.h" 17 #include "SkImage_Base.h"
18 #include "SkPaint.h" 18 #include "SkPaint.h"
19 #include "SkPath.h" 19 #include "SkPath.h"
20 #include "SkPathOps.h" 20 #include "SkPathOps.h"
21 #include "SkPDFBitmap.h" 21 #include "SkPDFBitmap.h"
22 #include "SkPDFFont.h" 22 #include "SkPDFFont.h"
23 #include "SkPDFFormXObject.h" 23 #include "SkPDFFormXObject.h"
24 #include "SkPDFGraphicState.h" 24 #include "SkPDFGraphicState.h"
25 #include "SkPDFResourceDict.h" 25 #include "SkPDFResourceDict.h"
26 #include "SkPDFShader.h" 26 #include "SkPDFShader.h"
27 #include "SkPDFStream.h" 27 #include "SkPDFStream.h"
28 #include "SkPDFTypes.h" 28 #include "SkPDFTypes.h"
29 #include "SkPDFUtils.h" 29 #include "SkPDFUtils.h"
30 #include "SkPaint.h"
31 #include "SkPath.h"
32 #include "SkPathOps.h"
33 #include "SkRRect.h"
30 #include "SkRect.h" 34 #include "SkRect.h"
31 #include "SkRRect.h"
32 #include "SkString.h" 35 #include "SkString.h"
33 #include "SkSurface.h" 36 #include "SkSurface.h"
37 #include "SkTSet.h"
38 #include "SkTemplates.h"
34 #include "SkTextFormatParams.h" 39 #include "SkTextFormatParams.h"
35 #include "SkTemplates.h"
36 #include "SkTypefacePriv.h" 40 #include "SkTypefacePriv.h"
37 #include "SkTSet.h"
38 41
39 #define DPI_FOR_RASTER_SCALE_ONE 72 42 #define DPI_FOR_RASTER_SCALE_ONE 72
40 43
41 // Utility functions 44 // Utility functions
42 45
43 static void emit_pdf_color(SkColor color, SkWStream* result) { 46 static void emit_pdf_color(SkColor color, SkWStream* result) {
44 SkASSERT(SkColorGetA(color) == 0xFF); // We handle alpha elsewhere. 47 SkASSERT(SkColorGetA(color) == 0xFF); // We handle alpha elsewhere.
45 SkScalar colorMax = SkIntToScalar(0xFF); 48 SkScalar colorMax = SkIntToScalar(0xFF);
46 SkPDFScalar::Append( 49 SkPDFScalar::Append(
47 SkScalarDiv(SkIntToScalar(SkColorGetR(color)), colorMax), result); 50 SkScalarDiv(SkIntToScalar(SkColorGetR(color)), colorMax), result);
(...skipping 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after
2150 return; 2153 return;
2151 } 2154 }
2152 SkAutoTUnref<SkPDFObject> image(SkPDFBitmap::Create(fCanon, subsetBitmap)); 2155 SkAutoTUnref<SkPDFObject> image(SkPDFBitmap::Create(fCanon, subsetBitmap));
2153 if (!image) { 2156 if (!image) {
2154 return; 2157 return;
2155 } 2158 }
2156 2159
2157 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), 2160 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()),
2158 &content.entry()->fContent); 2161 &content.entry()->fContent);
2159 } 2162 }
OLDNEW
« no previous file with comments | « src/image/SkImage.cpp ('k') | src/utils/SkDeferredCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698