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

Unified Diff: ui/gfx/canvas_skia.cc

Issue 10790128: Revert 147915 - Cleanup gfx::Canvas now that 10562027 has landed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | « ui/gfx/canvas_linux.cc ('k') | ui/gfx/image/canvas_image_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas_skia.cc
===================================================================
--- ui/gfx/canvas_skia.cc (revision 147935)
+++ ui/gfx/canvas_skia.cc (working copy)
@@ -377,7 +377,7 @@
// Create a temporary buffer filled with the halo color. It must leave room
// for the 1-pixel border around the text.
Size size(w + 2, h + 2);
- Canvas text_canvas(size, scale_factor(), true);
+ Canvas text_canvas(size, true);
SkPaint bkgnd_paint;
bkgnd_paint.setColor(halo_color);
text_canvas.DrawRect(gfx::Rect(size), bkgnd_paint);
@@ -390,9 +390,9 @@
SkBitmap& text_bitmap = const_cast<SkBitmap&>(
skia::GetTopDevice(*text_canvas.sk_canvas())->accessBitmap(true));
- for (int cur_y = 0; cur_y < text_bitmap.height(); cur_y++) {
+ for (int cur_y = 0; cur_y < h + 2; cur_y++) {
uint32_t* text_row = text_bitmap.getAddr32(0, cur_y);
- for (int cur_x = 0; cur_x < text_bitmap.width(); cur_x++) {
+ for (int cur_x = 0; cur_x < w + 2; cur_x++) {
if (text_row[cur_x] == halo_premul) {
// This pixel was not touched by the text routines. See if it borders
// a touched pixel in any of the 4 directions (not diagonally).
@@ -405,9 +405,7 @@
}
// Draw the halo bitmap with blur.
- gfx::ImageSkia text_image = gfx::ImageSkia(gfx::ImageSkiaRep(text_bitmap,
- text_canvas.scale_factor()));
- DrawImageInt(text_image, x - 1, y - 1);
+ DrawImageInt(text_bitmap, x - 1, y - 1);
}
void Canvas::DrawFadeTruncatingString(
« no previous file with comments | « ui/gfx/canvas_linux.cc ('k') | ui/gfx/image/canvas_image_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698