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

Unified Diff: chrome/renderer/print_web_view_helper.cc

Issue 9380051: Coverity: Fix a few pass-by-values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | « chrome/browser/extensions/api/declarative/initializing_rules_registry.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper.cc
diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc
index 7f7030dedd9888cd34f06abed2e2f9ef2ef2e1aa..9844b251b2fa2eb70341fa44585421be57d45a0c 100644
--- a/chrome/renderer/print_web_view_helper.cc
+++ b/chrome/renderer/print_web_view_helper.cc
@@ -383,7 +383,7 @@ SkPoint GetHeaderFooterPosition(
void PrintHeaderFooterText(
const string16& text,
WebKit::WebCanvas* canvas,
- HeaderFooterPaint paint,
+ const HeaderFooterPaint& paint,
float webkit_scale_factor,
const PageSizeMargins& page_layout,
printing::HorizontalHeaderFooterPosition horizontal_position,
@@ -397,10 +397,7 @@ void PrintHeaderFooterText(
horizontal_position,
vertical_position, offset_to_baseline,
text_width_in_points);
- paint.setTextSize(SkDoubleToScalar(
- paint.getTextSize() / webkit_scale_factor));
- canvas->drawText(text.c_str(), text_byte_length, point.x(), point.y(),
- paint);
+ canvas->drawText(text.c_str(), text_byte_length, point.x(), point.y(), paint);
#elif defined(OS_MACOSX)
ScopedCFTypeRef<CFStringRef> cf_text(base::SysUTF16ToCFStringRef(text));
ScopedCFTypeRef<CFAttributedStringRef> cf_attr_text(
@@ -485,7 +482,8 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
SkPaint paint;
paint.setColor(SK_ColorBLACK);
paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);
- paint.setTextSize(SkDoubleToScalar(printing::kSettingHeaderFooterFontSize));
+ paint.setTextSize(SkDoubleToScalar(
+ printing::kSettingHeaderFooterFontSize / webkit_scale_factor));
groby-ooo-7-16 2012/02/13 01:19:34 Are you sure setTextSize can be hoisted up to here
paint.setTypeface(SkTypeface::CreateFromName(
printing::kSettingHeaderFooterFontFamilyName, SkTypeface::kNormal));
#elif defined(OS_MACOSX)
« no previous file with comments | « chrome/browser/extensions/api/declarative/initializing_rules_registry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698