| OLD | NEW |
| 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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
| 9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
| 10 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 canvas.flush(); | 304 canvas.flush(); |
| 305 | 305 |
| 306 SkString out; | 306 SkString out; |
| 307 | 307 |
| 308 // TODO(edisonn): get the image, and overlay on top of it, the clip , gr
afic state, teh stack, | 308 // TODO(edisonn): get the image, and overlay on top of it, the clip , gr
afic state, teh stack, |
| 309 // ... and other properties, to be able to debug th code easily | 309 // ... and other properties, to be able to debug th code easily |
| 310 | 310 |
| 311 out.appendf("/usr/local/google/home/edisonn/log_view2/step-%i-%s.png", g
LastOpKeyword, gLastKeyword); | 311 out.appendf("/usr/local/google/home/edisonn/log_view2/step-%i-%s.png", g
LastOpKeyword, gLastKeyword); |
| 312 SkImageEncoder::EncodeFile(out.c_str(), bitmap, SkImageEncoder::kPNG_Typ
e, 100); | 312 SkImageEncoder::EncodeFile(out.c_str(), bitmap, SkImageEncoder::kPNG_Typ
e, 100); |
| 313 } | 313 } |
| 314 | |
| 315 if (token->fType == kKeyword_TokenType) { | |
| 316 strcpy(gLastKeyword, token->fKeyword); | |
| 317 gLastOpKeyword = gReadOp; | |
| 318 } else { | |
| 319 strcpy(gLastKeyword, ""); | |
| 320 } | |
| 321 #endif | 314 #endif |
| 322 | 315 |
| 323 return ret; | 316 return ret; |
| 324 } | 317 } |
| 325 | 318 |
| 326 | 319 |
| 327 | 320 |
| 328 typedef PdfResult (*PdfOperatorRenderer)(PdfContext*, SkCanvas*, PdfTokenLooper*
*); | 321 typedef PdfResult (*PdfOperatorRenderer)(PdfContext*, SkCanvas*, PdfTokenLooper*
*); |
| 329 | 322 |
| 330 SkTDict<PdfOperatorRenderer> gPdfOps(100); | 323 SkTDict<PdfOperatorRenderer> gPdfOps(100); |
| (...skipping 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2626 | 2619 |
| 2627 rect = SkRect::MakeWH(width, height); | 2620 rect = SkRect::MakeWH(width, height); |
| 2628 | 2621 |
| 2629 setup_bitmap(output, (int)SkScalarToDouble(width), (int)SkScalarToDouble(hei
ght)); | 2622 setup_bitmap(output, (int)SkScalarToDouble(width), (int)SkScalarToDouble(hei
ght)); |
| 2630 | 2623 |
| 2631 SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (*output))); | 2624 SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (*output))); |
| 2632 SkCanvas canvas(device); | 2625 SkCanvas canvas(device); |
| 2633 | 2626 |
| 2634 return renderer.renderPage(page, &canvas, rect); | 2627 return renderer.renderPage(page, &canvas, rect); |
| 2635 } | 2628 } |
| OLD | NEW |