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

Side by Side Diff: webkit/port/platform/graphics/chromium/FontChromiumWin.cpp

Issue 14079: Move skia_utils into the skia namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 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 | « skia/ext/vector_device.cc ('k') | webkit/port/rendering/RenderThemeWin.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 (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 // Set up our graphics context. 63 // Set up our graphics context.
64 HDC hdc = context->canvas()->beginPlatformPaint(); 64 HDC hdc = context->canvas()->beginPlatformPaint();
65 HGDIOBJ oldFont = SelectObject(hdc, font->platformData().hfont()); 65 HGDIOBJ oldFont = SelectObject(hdc, font->platformData().hfont());
66 66
67 // TODO(maruel): http://b/700464 SetTextColor doesn't support transparency. 67 // TODO(maruel): http://b/700464 SetTextColor doesn't support transparency.
68 // Enforce non-transparent color. 68 // Enforce non-transparent color.
69 color = SkColorSetRGB(SkColorGetR(color), 69 color = SkColorSetRGB(SkColorGetR(color),
70 SkColorGetG(color), 70 SkColorGetG(color),
71 SkColorGetB(color)); 71 SkColorGetB(color));
72 SetTextColor(hdc, gfx::SkColorToCOLORREF(color)); 72 SetTextColor(hdc, skia::SkColorToCOLORREF(color));
73 SetBkMode(hdc, TRANSPARENT); 73 SetBkMode(hdc, TRANSPARENT);
74 74
75 // Windows needs the characters and the advances in nice contiguous 75 // Windows needs the characters and the advances in nice contiguous
76 // buffers, which we build here. 76 // buffers, which we build here.
77 Vector<WORD, kDefaultBufferLength> glyphs; 77 Vector<WORD, kDefaultBufferLength> glyphs;
78 Vector<int, kDefaultBufferLength> advances; 78 Vector<int, kDefaultBufferLength> advances;
79 79
80 // Compute the coordinate. The 'origin' represents the baseline, so we need 80 // Compute the coordinate. The 'origin' represents the baseline, so we need
81 // to move it up to the top of the bounding square. 81 // to move it up to the top of the bounding square.
82 int x = static_cast<int>(point.x()); 82 int x = static_cast<int>(point.x());
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 if (!alpha) 161 if (!alpha)
162 return; 162 return;
163 163
164 HDC hdc = context->canvas()->beginPlatformPaint(); 164 HDC hdc = context->canvas()->beginPlatformPaint();
165 165
166 // TODO(maruel): http://b/700464 SetTextColor doesn't support transparency. 166 // TODO(maruel): http://b/700464 SetTextColor doesn't support transparency.
167 // Enforce non-transparent color. 167 // Enforce non-transparent color.
168 color = SkColorSetRGB(SkColorGetR(color), 168 color = SkColorSetRGB(SkColorGetR(color),
169 SkColorGetG(color), 169 SkColorGetG(color),
170 SkColorGetB(color)); 170 SkColorGetB(color));
171 SetTextColor(hdc, gfx::SkColorToCOLORREF(color)); 171 SetTextColor(hdc, skia::SkColorToCOLORREF(color));
172 SetBkMode(hdc, TRANSPARENT); 172 SetBkMode(hdc, TRANSPARENT);
173 173
174 // Uniscribe counts the coordinates from the upper left, while WebKit uses 174 // Uniscribe counts the coordinates from the upper left, while WebKit uses
175 // the baseline, so we have to subtract off the ascent. 175 // the baseline, so we have to subtract off the ascent.
176 state.Draw(hdc, 176 state.Draw(hdc,
177 static_cast<int>(point.x()), 177 static_cast<int>(point.x()),
178 static_cast<int>(point.y() - ascent()), 178 static_cast<int>(point.y() - ascent()),
179 from, 179 from,
180 to); 180 to);
181 context->canvas()->endPlatformPaint(); 181 context->canvas()->endPlatformPaint();
(...skipping 14 matching lines...) Expand all
196 int char_index = state.XToCharacter(x); 196 int char_index = state.XToCharacter(x);
197 197
198 // XToCharacter will return -1 if the position is before the first 198 // XToCharacter will return -1 if the position is before the first
199 // character (we get called like this sometimes). 199 // character (we get called like this sometimes).
200 if (char_index < 0) 200 if (char_index < 0)
201 char_index = 0; 201 char_index = 0;
202 return char_index; 202 return char_index;
203 } 203 }
204 204
205 } // namespace WebCore 205 } // namespace WebCore
OLDNEW
« no previous file with comments | « skia/ext/vector_device.cc ('k') | webkit/port/rendering/RenderThemeWin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698