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

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

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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
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 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 // Grabbing the damaged regions failed, fake with the whole rect. 1390 // Grabbing the damaged regions failed, fake with the whole rect.
1391 data_size = sizeof(RGNDATAHEADER) + sizeof(RECT); 1391 data_size = sizeof(RGNDATAHEADER) + sizeof(RECT);
1392 region_data_buf.reset(new char[data_size]); 1392 region_data_buf.reset(new char[data_size]);
1393 region_data = reinterpret_cast<RGNDATA*>(region_data_buf.get()); 1393 region_data = reinterpret_cast<RGNDATA*>(region_data_buf.get());
1394 region_rects = reinterpret_cast<RECT*>(region_data->Buffer); 1394 region_rects = reinterpret_cast<RECT*>(region_data->Buffer);
1395 region_data->rdh.nCount = 1; 1395 region_data->rdh.nCount = 1;
1396 region_rects[0] = damaged_rect.ToRECT(); 1396 region_rects[0] = damaged_rect.ToRECT();
1397 } 1397 }
1398 1398
1399 for (DWORD i = 0; i < region_data->rdh.nCount; ++i) { 1399 for (DWORD i = 0; i < region_data->rdh.nCount; ++i) {
1400 gfx::Rect paint_rect = bitmap_rect.Intersect(gfx::Rect(region_rects[i])); 1400 gfx::Rect paint_rect = bitmap_rect;
1401 paint_rect.Intersect(gfx::Rect(region_rects[i]));
1401 if (!paint_rect.IsEmpty()) { 1402 if (!paint_rect.IsEmpty()) {
1402 BitBlt(paint_dc.m_hDC, 1403 BitBlt(paint_dc.m_hDC,
1403 paint_rect.x(), 1404 paint_rect.x(),
1404 paint_rect.y(), 1405 paint_rect.y(),
1405 paint_rect.width(), 1406 paint_rect.width(),
1406 paint_rect.height(), 1407 paint_rect.height(),
1407 backing_store->hdc(), 1408 backing_store->hdc(),
1408 paint_rect.x(), 1409 paint_rect.x(),
1409 paint_rect.y(), 1410 paint_rect.y(),
1410 SRCCOPY); 1411 SRCCOPY);
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
3130 // receive a focus change in the context of a pointer down message, it means 3131 // receive a focus change in the context of a pointer down message, it means
3131 // that the pointer down message occurred on the edit field and we should 3132 // that the pointer down message occurred on the edit field and we should
3132 // display the on screen keyboard 3133 // display the on screen keyboard
3133 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 3134 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
3134 DisplayOnScreenKeyboardIfNeeded(); 3135 DisplayOnScreenKeyboardIfNeeded();
3135 received_focus_change_after_pointer_down_ = false; 3136 received_focus_change_after_pointer_down_ = false;
3136 pointer_down_context_ = false; 3137 pointer_down_context_ = false;
3137 } 3138 }
3138 3139
3139 } // namespace content 3140 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698