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

Unified Diff: experimental/PdfViewer/pdf_viewer_main.cpp

Issue 26700002: remove tracking code, as it polutes the code readability. Should be added back, in a less eficient … (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/PdfViewer/SkPdfConfig.h ('k') | experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/pdf_viewer_main.cpp
===================================================================
--- experimental/PdfViewer/pdf_viewer_main.cpp (revision 11625)
+++ experimental/PdfViewer/pdf_viewer_main.cpp (working copy)
@@ -49,6 +49,7 @@
#endif
"\tnul - render in null canvas, any draw will just return.\n"
);
+DEFINE_bool2(transparentBackground, t, false, "Make background transparent instead of white.");
// TODO(edisonn): add config for device target(gpu, raster, pdf), + ability not to render at all
@@ -156,7 +157,7 @@
PNG_FILE_EXTENSION);
}
-static void setup_bitmap(SkBitmap* bitmap, int width, int height, SkColor color = SK_ColorTRANSPARENT) {
+static void setup_bitmap(SkBitmap* bitmap, int width, int height, SkColor color) {
bitmap->setConfig(SkBitmap::kARGB_8888_Config, width, height);
bitmap->allocPixels();
@@ -199,10 +200,12 @@
rect = SkRect::MakeWH(width, height);
+ SkColor background = FLAGS_transparentBackground ? SK_ColorTRANSPARENT : SK_ColorWHITE;
+
#ifdef PDF_DEBUG_3X
- setup_bitmap(&bitmap, 3 * (int)SkScalarToDouble(width), 3 * (int)SkScalarToDouble(height));
+ setup_bitmap(&bitmap, 3 * (int)SkScalarToDouble(width), 3 * (int)SkScalarToDouble(height), background);
#else
- setup_bitmap(&bitmap, (int)SkScalarToDouble(width), (int)SkScalarToDouble(height));
+ setup_bitmap(&bitmap, (int)SkScalarToDouble(width), (int)SkScalarToDouble(height), background);
#endif
SkAutoTUnref<SkBaseDevice> device;
if (strcmp(FLAGS_config[0], "8888") == 0) {
« no previous file with comments | « experimental/PdfViewer/SkPdfConfig.h ('k') | experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698