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

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

Issue 22269002: pdfviewer: debug code for crash (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkForceLinking.h" 10 #include "SkForceLinking.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 blueBorder.setTextSize(SkDoubleToScalar(20)); 258 blueBorder.setTextSize(SkDoubleToScalar(20));
259 259
260 SkString str; 260 SkString str;
261 261
262 const SkClipStack* clipStack = gDumpCanvas->getClipStack(); 262 const SkClipStack* clipStack = gDumpCanvas->getClipStack();
263 if (clipStack) { 263 if (clipStack) {
264 SkClipStack::Iter iter(*clipStack, SkClipStack::Iter::kBottom_IterSt art); 264 SkClipStack::Iter iter(*clipStack, SkClipStack::Iter::kBottom_IterSt art);
265 const SkClipStack::Element* elem; 265 const SkClipStack::Element* elem;
266 double y = 0; 266 double y = 0;
267 int total = 0; 267 int total = 0;
268 while (elem = iter.next()) { 268 while ((elem = iter.next()) != NULL) {
269 total++; 269 total++;
270 y += 30; 270 y += 30;
271 271
272 switch (elem->getType()) { 272 switch (elem->getType()) {
273 case SkClipStack::Element::kRect_Type: 273 case SkClipStack::Element::kRect_Type:
274 canvas.drawRect(elem->getRect(), blueBorder); 274 canvas.drawRect(elem->getRect(), blueBorder);
275 canvas.drawText("Rect Clip", strlen("Rect Clip"), SkDoub leToScalar(10), SkDoubleToScalar(y), blueBorder); 275 canvas.drawText("Rect Clip", strlen("Rect Clip"), SkDoub leToScalar(10), SkDoubleToScalar(y), blueBorder);
276 break; 276 break;
277 case SkClipStack::Element::kPath_Type: 277 case SkClipStack::Element::kPath_Type:
278 canvas.drawPath(elem->getPath(), blueBorder); 278 canvas.drawPath(elem->getPath(), blueBorder);
(...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after
2626 2626
2627 rect = SkRect::MakeWH(width, height); 2627 rect = SkRect::MakeWH(width, height);
2628 2628
2629 setup_bitmap(output, (int)SkScalarToDouble(width), (int)SkScalarToDouble(hei ght)); 2629 setup_bitmap(output, (int)SkScalarToDouble(width), (int)SkScalarToDouble(hei ght));
2630 2630
2631 SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (*output))); 2631 SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (*output)));
2632 SkCanvas canvas(device); 2632 SkCanvas canvas(device);
2633 2633
2634 return renderer.renderPage(page, &canvas, rect); 2634 return renderer.renderPage(page, &canvas, rect);
2635 } 2635 }
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfBasics.h ('k') | experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698