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

Unified Diff: gfx/canvas_skia_win.cc

Issue 6121004: Remove wstring from gfx. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « gfx/canvas_skia_mac.mm ('k') | gfx/font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gfx/canvas_skia_win.cc
===================================================================
--- gfx/canvas_skia_win.cc (revision 71043)
+++ gfx/canvas_skia_win.cc (working copy)
@@ -16,7 +16,7 @@
// We make sure that LTR text we draw in an RTL context is modified
// appropriately to make sure it maintains it LTR orientation.
void DoDrawText(HDC hdc,
- const std::wstring& text,
+ const string16& text,
RECT* text_bounds,
int flags) {
// Only adjust string directionality if both of the following are true:
@@ -25,7 +25,7 @@
const wchar_t* string_ptr = text.c_str();
int string_size = static_cast<int>(text.length());
- std::wstring localized_text;
+ string16 localized_text;
if (flags & DT_RTLREADING) {
localized_text = text;
base::i18n::AdjustStringForLocaleDirection(&localized_text);
@@ -38,7 +38,7 @@
// Compute the windows flags necessary to implement the provided text Canvas
// flags.
-int ComputeFormatFlags(int flags, const std::wstring& text) {
+int ComputeFormatFlags(int flags, const string16& text) {
// Setting the text alignment explicitly in case it hasn't already been set.
// This will make sure that we don't align text to the left on RTL locales
// just because no alignment flag was passed to DrawStringInt().
@@ -139,7 +139,7 @@
}
// static
-void CanvasSkia::SizeStringInt(const std::wstring& text,
+void CanvasSkia::SizeStringInt(const string16& text,
const gfx::Font& font,
int* width, int* height,
int flags) {
@@ -147,7 +147,7 @@
// actually drawn, it will be clipped to whatever size box is provided, and
// the time to do that doesn't depend on the length being clipped off.
const int kMaxStringLength = 2048 - 1; // So the trailing \0 fits in 2K.
- std::wstring clamped_string(text.substr(0, kMaxStringLength));
+ string16 clamped_string(text.substr(0, kMaxStringLength));
if (*width == 0) {
// If multi-line + character break are on, the computed width will be one
@@ -177,7 +177,7 @@
*height = r.bottom;
}
-void CanvasSkia::DrawStringInt(const std::wstring& text,
+void CanvasSkia::DrawStringInt(const string16& text,
HFONT font,
const SkColor& color,
int x, int y, int w, int h,
@@ -190,7 +190,7 @@
// length > 43680 (for which it draws nothing), and since we clamped to 2K in
// SizeStringInt() we're unlikely to be able to display this much anyway.
const int kMaxStringLength = 32768 - 1; // So the trailing \0 fits in 32K.
- std::wstring clamped_string(text.substr(0, kMaxStringLength));
+ string16 clamped_string(text.substr(0, kMaxStringLength));
RECT text_bounds = { x, y, x + w, y + h };
HDC dc = beginPlatformPaint();
@@ -214,7 +214,7 @@
getTopPlatformDevice().makeOpaque(x, y, w, h);
}
-void CanvasSkia::DrawStringInt(const std::wstring& text,
+void CanvasSkia::DrawStringInt(const string16& text,
const gfx::Font& font,
const SkColor& color,
int x, int y, int w, int h,
@@ -250,7 +250,7 @@
return false;
}
-void CanvasSkia::DrawStringWithHalo(const std::wstring& text,
+void CanvasSkia::DrawStringWithHalo(const string16& text,
const gfx::Font& font,
const SkColor& text_color,
const SkColor& halo_color_in,
« no previous file with comments | « gfx/canvas_skia_mac.mm ('k') | gfx/font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698