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

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

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 years 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
« no previous file with comments | « experimental/DrawingBoard/SampleDrawingClient.cpp ('k') | gm/blurrect.cpp » ('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 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 "SkPdfRenderer.h" 8 #include "SkPdfRenderer.h"
9 9
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 skfont->encoding()->decodeText(binary, &decoded); 483 skfont->encoding()->decodeText(binary, &decoded);
484 484
485 SkPaint paint; 485 SkPaint paint;
486 // TODO(edisonn): does size 0 mean anything special? 486 // TODO(edisonn): does size 0 mean anything special?
487 if (pdfContext->fGraphicsState.fCurFontSize != 0) { 487 if (pdfContext->fGraphicsState.fCurFontSize != 0) {
488 paint.setTextSize(SkDoubleToScalar(pdfContext->fGraphicsState.fCurFontSi ze)); 488 paint.setTextSize(SkDoubleToScalar(pdfContext->fGraphicsState.fCurFontSi ze));
489 } 489 }
490 490
491 // TODO(edisonn): implement font scaler 491 // TODO(edisonn): implement font scaler
492 // if (fCurFont && fCurFont->GetFontScale() != 0) { 492 // if (fCurFont && fCurFont->GetFontScale() != 0) {
493 // paint.setTextScaleX(SkFloatToScalar(fCurFont->GetFontScale() / 100.0)) ; 493 // paint.setTextScaleX(fCurFont->GetFontScale() / 100.0);
494 // } 494 // }
495 495
496 pdfContext->fGraphicsState.applyGraphicsState(&paint, false); 496 pdfContext->fGraphicsState.applyGraphicsState(&paint, false);
497 497
498 skfont->drawText(decoded, &paint, pdfContext, canvas); 498 skfont->drawText(decoded, &paint, pdfContext, canvas);
499 499
500 return kOK_SkPdfResult; 500 return kOK_SkPdfResult;
501 } 501 }
502 502
503 // TODO(edisonn): create header files with declarations! 503 // TODO(edisonn): create header files with declarations!
(...skipping 2629 matching lines...) Expand 10 before | Expand all | Expand 10 after
3133 3133
3134 rect = SkRect::MakeWH(width, height); 3134 rect = SkRect::MakeWH(width, height);
3135 3135
3136 setup_bitmap(output, SkScalarCeilToInt(width), SkScalarCeilToInt(height)); 3136 setup_bitmap(output, SkScalarCeilToInt(width), SkScalarCeilToInt(height));
3137 3137
3138 SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (*output))); 3138 SkAutoTUnref<SkBaseDevice> device(SkNEW_ARGS(SkBitmapDevice, (*output)));
3139 SkCanvas canvas(device); 3139 SkCanvas canvas(device);
3140 3140
3141 return renderer->renderPage(page, &canvas, rect); 3141 return renderer->renderPage(page, &canvas, rect);
3142 } 3142 }
OLDNEW
« no previous file with comments | « experimental/DrawingBoard/SampleDrawingClient.cpp ('k') | gm/blurrect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698