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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.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, 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 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 DrawBackground(paint_dc.m_ps.rcPaint, &paint_dc); 1531 DrawBackground(paint_dc.m_ps.rcPaint, &paint_dc);
1532 if (whiteout_start_time_.is_null()) 1532 if (whiteout_start_time_.is_null())
1533 whiteout_start_time_ = TimeTicks::Now(); 1533 whiteout_start_time_ = TimeTicks::Now();
1534 } 1534 }
1535 } 1535 }
1536 1536
1537 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect, 1537 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect,
1538 CPaintDC* dc) { 1538 CPaintDC* dc) {
1539 if (!background_.empty()) { 1539 if (!background_.empty()) {
1540 gfx::Rect dirty_area(dirty_rect); 1540 gfx::Rect dirty_area(dirty_rect);
1541 gfx::Canvas canvas(dirty_area.size(), ui::SCALE_FACTOR_100P, true); 1541 gfx::Canvas canvas(dirty_area.size(), true);
1542 canvas.Translate(gfx::Point().Subtract(dirty_area.origin())); 1542 canvas.Translate(gfx::Point().Subtract(dirty_area.origin()));
1543 1543
1544 gfx::Rect dc_rect(dc->m_ps.rcPaint); 1544 gfx::Rect dc_rect(dc->m_ps.rcPaint);
1545 canvas.TileImageInt(background_, 0, 0, dc_rect.width(), dc_rect.height()); 1545 canvas.TileImageInt(background_, 0, 0, dc_rect.width(), dc_rect.height());
1546 1546
1547 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(), 1547 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(),
1548 dirty_area.y(), NULL); 1548 dirty_area.y(), NULL);
1549 } else { 1549 } else {
1550 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); 1550 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
1551 dc->FillRect(&dirty_rect, white_brush); 1551 dc->FillRect(&dirty_rect, white_brush);
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3155 // receive a focus change in the context of a pointer down message, it means 3155 // receive a focus change in the context of a pointer down message, it means
3156 // that the pointer down message occurred on the edit field and we should 3156 // that the pointer down message occurred on the edit field and we should
3157 // display the on screen keyboard 3157 // display the on screen keyboard
3158 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 3158 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
3159 DisplayOnScreenKeyboardIfNeeded(); 3159 DisplayOnScreenKeyboardIfNeeded();
3160 received_focus_change_after_pointer_down_ = false; 3160 received_focus_change_after_pointer_down_ = false;
3161 pointer_down_context_ = false; 3161 pointer_down_context_ = false;
3162 } 3162 }
3163 3163
3164 } // namespace content 3164 } // 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