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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/pdf/SkPDFBitmap.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 2015 Google Inc. 2 * Copyright 2015 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 "gm.h" 8 #include "gm.h"
9 #include "sk_tool_utils.h" 9 #include "sk_tool_utils.h"
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 11 matching lines...) Expand all
22 canvas->scale(12.0f, 12.0f); 22 canvas->scale(12.0f, 12.0f);
23 canvas->translate(6.0f + 12.0f * SkIntToScalar(i), 23 canvas->translate(6.0f + 12.0f * SkIntToScalar(i),
24 6.0f + 12.0f * SkIntToScalar(j)); 24 6.0f + 12.0f * SkIntToScalar(j));
25 canvas->rotate(18.0f * (i + 4 * j)); 25 canvas->rotate(18.0f * (i + 4 * j));
26 canvas->drawRect(rect, paint); 26 canvas->drawRect(rect, paint);
27 canvas->drawBitmap(bm, -4.0f, -4.0f); 27 canvas->drawBitmap(bm, -4.0f, -4.0f);
28 } 28 }
29 } 29 }
30 } 30 }
31 } 31 }
32
33 DEF_SIMPLE_GM(repeated_bitmap_jpg, canvas, 576, 576) {
34 sk_tool_utils::draw_checkerboard(canvas, 0xFF999999, SK_ColorWHITE, 12);
35 SkRect rect = SkRect::MakeLTRB(-68.0f, -68.0f, 68.0f, 68.0f);
36 SkPaint paint;
37 paint.setColor(0xFF333333);
38 SkBitmap bm;
39 if (GetResourceAsBitmap("color_wheel.jpg", &bm)) {
40 for (int j = 0; j < 4; ++j) {
41 for (int i = 0; i < 4; ++i) {
42 SkAutoCanvasRestore autoCanvasRestore(canvas, true);
43 canvas->translate(96.0f + 192.0f * SkIntToScalar(i),
44 96.0f + 192.0f * SkIntToScalar(j));
45 canvas->rotate(18.0f * (i + 4 * j));
46 canvas->drawRect(rect, paint);
47 canvas->drawBitmap(bm, -64.0f, -64.0f);
48 }
49 }
50 }
51 }
OLDNEW
« 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