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

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

Issue 9332006: ui/gfx: Make the first version of Canvas::TileImageInt take a gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 <peninputpanel_i.c> 8 #include <peninputpanel_i.c>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 } 1126 }
1127 1127
1128 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect, 1128 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect,
1129 CPaintDC* dc) { 1129 CPaintDC* dc) {
1130 if (!background_.empty()) { 1130 if (!background_.empty()) {
1131 gfx::Rect dirty_area(dirty_rect); 1131 gfx::Rect dirty_area(dirty_rect);
1132 gfx::CanvasSkia canvas(dirty_area.size(), true); 1132 gfx::CanvasSkia canvas(dirty_area.size(), true);
1133 canvas.Translate(gfx::Point().Subtract(dirty_area.origin())); 1133 canvas.Translate(gfx::Point().Subtract(dirty_area.origin()));
1134 1134
1135 gfx::Rect dc_rect(dc->m_ps.rcPaint); 1135 gfx::Rect dc_rect(dc->m_ps.rcPaint);
1136 canvas.TileImageInt(background_, 0, 0, dc_rect.width(), dc_rect.height()); 1136 canvas.TileImage(background_,
Peter Kasting 2012/02/06 22:32:39 Nit: Simpler: dc_rect.set_origin(gfx::Point());
tfarina 2012/02/06 23:12:16 Done.
1137 gfx::Rect(0, 0, dc_rect.width(), dc_rect.height()));
1137 1138
1138 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(), 1139 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(),
1139 dirty_area.y(), NULL); 1140 dirty_area.y(), NULL);
1140 } else { 1141 } else {
1141 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); 1142 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
1142 dc->FillRect(&dirty_rect, white_brush); 1143 dc->FillRect(&dirty_rect, white_brush);
1143 } 1144 }
1144 } 1145 }
1145 1146
1146 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) { 1147 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) {
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
2601 void RenderWidgetHostViewWin::ResetPointerDownContext() { 2602 void RenderWidgetHostViewWin::ResetPointerDownContext() {
2602 // If the default focus on the page is on an edit field and we did not 2603 // If the default focus on the page is on an edit field and we did not
2603 // receive a focus change in the context of a pointer down message, it means 2604 // receive a focus change in the context of a pointer down message, it means
2604 // that the pointer down message occurred on the edit field and we should 2605 // that the pointer down message occurred on the edit field and we should
2605 // display the on screen keyboard 2606 // display the on screen keyboard
2606 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 2607 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
2607 DisplayOnScreenKeyboardIfNeeded(); 2608 DisplayOnScreenKeyboardIfNeeded();
2608 received_focus_change_after_pointer_down_ = false; 2609 received_focus_change_after_pointer_down_ = false;
2609 pointer_down_context_ = false; 2610 pointer_down_context_ = false;
2610 } 2611 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698