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

Unified Diff: gm/repeated_bitmap.cpp

Issue 1025773002: PDF: Correctly embed JPEG images directly into PDF output. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-04-17 (Friday) 16:19:22 EDT Created 5 years, 8 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 | « no previous file | src/pdf/SkPDFBitmap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/repeated_bitmap.cpp
diff --git a/gm/repeated_bitmap.cpp b/gm/repeated_bitmap.cpp
index fa5fe0c1363ab418b8952602ba993a0d76152f2f..e6b06365e6724d2b297073cd49fcbeb683d0f872 100644
--- a/gm/repeated_bitmap.cpp
+++ b/gm/repeated_bitmap.cpp
@@ -29,3 +29,23 @@ DEF_SIMPLE_GM(repeated_bitmap, canvas, 576, 576) {
}
}
}
+
+DEF_SIMPLE_GM(repeated_bitmap_jpg, canvas, 576, 576) {
+ sk_tool_utils::draw_checkerboard(canvas, 0xFF999999, SK_ColorWHITE, 12);
+ SkRect rect = SkRect::MakeLTRB(-68.0f, -68.0f, 68.0f, 68.0f);
+ SkPaint paint;
+ paint.setColor(0xFF333333);
+ SkBitmap bm;
+ if (GetResourceAsBitmap("color_wheel.jpg", &bm)) {
+ for (int j = 0; j < 4; ++j) {
+ for (int i = 0; i < 4; ++i) {
+ SkAutoCanvasRestore autoCanvasRestore(canvas, true);
+ canvas->translate(96.0f + 192.0f * SkIntToScalar(i),
+ 96.0f + 192.0f * SkIntToScalar(j));
+ canvas->rotate(18.0f * (i + 4 * j));
+ canvas->drawRect(rect, paint);
+ canvas->drawBitmap(bm, -64.0f, -64.0f);
+ }
+ }
+ }
+}
« no previous file with comments | « no previous file | src/pdf/SkPDFBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698