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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 10701063: Cleanup gfx::Canvas now that 10562027 has landed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_win.h" 5 #include "content/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <peninputpanel_i.c> 9 #include <peninputpanel_i.c>
10 #include <stack> 10 #include <stack>
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 DrawBackground(paint_dc.m_ps.rcPaint, &paint_dc); 1538 DrawBackground(paint_dc.m_ps.rcPaint, &paint_dc);
1539 if (whiteout_start_time_.is_null()) 1539 if (whiteout_start_time_.is_null())
1540 whiteout_start_time_ = TimeTicks::Now(); 1540 whiteout_start_time_ = TimeTicks::Now();
1541 } 1541 }
1542 } 1542 }
1543 1543
1544 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect, 1544 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect,
1545 CPaintDC* dc) { 1545 CPaintDC* dc) {
1546 if (!background_.empty()) { 1546 if (!background_.empty()) {
1547 gfx::Rect dirty_area(dirty_rect); 1547 gfx::Rect dirty_area(dirty_rect);
1548 gfx::Canvas canvas(dirty_area.size(), true); 1548 gfx::Canvas canvas(dirty_area.size(), ui::SCALE_FACTOR_100P, true);
1549 canvas.Translate(gfx::Point().Subtract(dirty_area.origin())); 1549 canvas.Translate(gfx::Point().Subtract(dirty_area.origin()));
1550 1550
1551 gfx::Rect dc_rect(dc->m_ps.rcPaint); 1551 gfx::Rect dc_rect(dc->m_ps.rcPaint);
1552 canvas.TileImageInt(background_, 0, 0, dc_rect.width(), dc_rect.height()); 1552 canvas.TileImageInt(background_, 0, 0, dc_rect.width(), dc_rect.height());
1553 1553
1554 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(), 1554 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(),
1555 dirty_area.y(), NULL); 1555 dirty_area.y(), NULL);
1556 } else { 1556 } else {
1557 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); 1557 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
1558 dc->FillRect(&dirty_rect, white_brush); 1558 dc->FillRect(&dirty_rect, white_brush);
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3162 // receive a focus change in the context of a pointer down message, it means 3162 // receive a focus change in the context of a pointer down message, it means
3163 // that the pointer down message occurred on the edit field and we should 3163 // that the pointer down message occurred on the edit field and we should
3164 // display the on screen keyboard 3164 // display the on screen keyboard
3165 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 3165 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
3166 DisplayOnScreenKeyboardIfNeeded(); 3166 DisplayOnScreenKeyboardIfNeeded();
3167 received_focus_change_after_pointer_down_ = false; 3167 received_focus_change_after_pointer_down_ = false;
3168 pointer_down_context_ = false; 3168 pointer_down_context_ = false;
3169 } 3169 }
3170 3170
3171 } // namespace content 3171 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_unittest.cc ('k') | ui/base/clipboard/clipboard_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698