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

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: put back the Peter's nits 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
« no previous file with comments | « chrome/common/extensions/extension_action.cc ('k') | ui/gfx/canvas.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 } 1142 }
1143 1143
1144 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect, 1144 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect,
1145 CPaintDC* dc) { 1145 CPaintDC* dc) {
1146 if (!background_.empty()) { 1146 if (!background_.empty()) {
1147 gfx::Rect dirty_area(dirty_rect); 1147 gfx::Rect dirty_area(dirty_rect);
1148 gfx::CanvasSkia canvas(dirty_area.size(), true); 1148 gfx::CanvasSkia canvas(dirty_area.size(), true);
1149 canvas.Translate(gfx::Point().Subtract(dirty_area.origin())); 1149 canvas.Translate(gfx::Point().Subtract(dirty_area.origin()));
1150 1150
1151 gfx::Rect dc_rect(dc->m_ps.rcPaint); 1151 gfx::Rect dc_rect(dc->m_ps.rcPaint);
1152 canvas.TileImageInt(background_, 0, 0, dc_rect.width(), dc_rect.height()); 1152 dc_rect.set_origin(gfx::Point());
1153 canvas.TileImage(background_, dc_rect);
1153 1154
1154 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(), 1155 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(),
1155 dirty_area.y(), NULL); 1156 dirty_area.y(), NULL);
1156 } else { 1157 } else {
1157 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); 1158 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
1158 dc->FillRect(&dirty_rect, white_brush); 1159 dc->FillRect(&dirty_rect, white_brush);
1159 } 1160 }
1160 } 1161 }
1161 1162
1162 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) { 1163 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) {
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after
2616 void RenderWidgetHostViewWin::ResetPointerDownContext() { 2617 void RenderWidgetHostViewWin::ResetPointerDownContext() {
2617 // If the default focus on the page is on an edit field and we did not 2618 // If the default focus on the page is on an edit field and we did not
2618 // receive a focus change in the context of a pointer down message, it means 2619 // receive a focus change in the context of a pointer down message, it means
2619 // that the pointer down message occurred on the edit field and we should 2620 // that the pointer down message occurred on the edit field and we should
2620 // display the on screen keyboard 2621 // display the on screen keyboard
2621 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 2622 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
2622 DisplayOnScreenKeyboardIfNeeded(); 2623 DisplayOnScreenKeyboardIfNeeded();
2623 received_focus_change_after_pointer_down_ = false; 2624 received_focus_change_after_pointer_down_ = false;
2624 pointer_down_context_ = false; 2625 pointer_down_context_ = false;
2625 } 2626 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_action.cc ('k') | ui/gfx/canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698