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

Side by Side Diff: experimental/PdfViewer/src/SkPdfRenderer.cpp

Issue 670453002: Remove image decoder and encoder autoregistration (Closed) Base URL: https://skia.googlesource.com/skia.git@separate-image-decoder-01-skpicture
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "SkPdfRenderer.h" 8 #include "SkPdfRenderer.h"
9 9
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkDevice.h" 12 #include "SkDevice.h"
13 #include "SkForceLinking.h"
14 #include "SkGraphics.h" 13 #include "SkGraphics.h"
15 #include "SkImageDecoder.h" 14 #include "SkImageDecoder.h"
16 #include "SkImageEncoder.h" 15 #include "SkImageEncoder.h"
17 #include "SkOSFile.h" 16 #include "SkOSFile.h"
18 #include "SkPicture.h" 17 #include "SkPicture.h"
19 #include "SkPdfFont.h" 18 #include "SkPdfFont.h"
20 #include "SkPdfGraphicsState.h" 19 #include "SkPdfGraphicsState.h"
21 #include "SkPdfHeaders_autogen.h" 20 #include "SkPdfHeaders_autogen.h"
22 #include "SkPdfMapper_autogen.h" 21 #include "SkPdfMapper_autogen.h"
23 #include "SkPdfNativeTokenizer.h" 22 #include "SkPdfNativeTokenizer.h"
24 #include "SkPdfRenderer.h" 23 #include "SkPdfRenderer.h"
25 #include "SkPdfReporter.h" 24 #include "SkPdfReporter.h"
26 #include "SkPdfTokenLooper.h" 25 #include "SkPdfTokenLooper.h"
27 #include "SkPdfUtils.h" 26 #include "SkPdfUtils.h"
28 #include "SkStream.h" 27 #include "SkStream.h"
29 #include "SkTypeface.h" 28 #include "SkTypeface.h"
30 #include "SkTArray.h" 29 #include "SkTArray.h"
31 #include "SkTDict.h" 30 #include "SkTDict.h"
32 31
33 // TODO(edisonn): #ifdef these ones, as they are used only for debugging. 32 // TODO(edisonn): #ifdef these ones, as they are used only for debugging.
34 extern "C" SkPdfContext* gPdfContext; 33 extern "C" SkPdfContext* gPdfContext;
35 34
36 __SK_FORCE_IMAGE_DECODER_LINKING;
37
38 // TODO(edisonn): tool, show what objects were read during rendering - will help to identify 35 // TODO(edisonn): tool, show what objects were read during rendering - will help to identify
39 // features with incomplete implementation 36 // features with incomplete implementation
40 // TODO(edisonn): security - validate all the user input, all pdf! 37 // TODO(edisonn): security - validate all the user input, all pdf!
41 // TODO(edisonn): testability -add option to render without text, or only render text 38 // TODO(edisonn): testability -add option to render without text, or only render text
42 39
43 // Helper macros to load variables from stack, and automatically check their typ e. 40 // Helper macros to load variables from stack, and automatically check their typ e.
44 #define EXPECT_OPERANDS(name,pdfContext,n) \ 41 #define EXPECT_OPERANDS(name,pdfContext,n) \
45 bool __failed = pdfContext->fObjectStack.count() < n; \ 42 bool __failed = pdfContext->fObjectStack.count() < n; \
46 SkPdfREPORTCODE(const char* __operator_name = name); \ 43 SkPdfREPORTCODE(const char* __operator_name = name); \
47 SkPdfREPORTCODE((void)__operator_name); \ 44 SkPdfREPORTCODE((void)__operator_name); \
(...skipping 2858 matching lines...) Expand 10 before | Expand all | Expand 10 after
2906 2903
2907 rect = SkRect::MakeWH(width, height); 2904 rect = SkRect::MakeWH(width, height);
2908 2905
2909 setup_bitmap(output, SkScalarCeilToInt(width), SkScalarCeilToInt(height)); 2906 setup_bitmap(output, SkScalarCeilToInt(width), SkScalarCeilToInt(height));
2910 2907
2911 SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (*output))); 2908 SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (*output)));
2912 SkCanvas canvas(device); 2909 SkCanvas canvas(device);
2913 2910
2914 return renderer->renderPage(page, &canvas, rect); 2911 return renderer->renderPage(page, &canvas, rect);
2915 } 2912 }
OLDNEW
« no previous file with comments | « experimental/PdfViewer/chop_transparency_main.cpp ('k') | experimental/nanomsg/picture_demo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698