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

Side by Side Diff: ui/views/widget/native_widget_win.cc

Issue 8383028: ui/gfx: Convert Canvas::ClipRectInt() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 9 years, 1 month 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 | « ui/views/view.cc ('k') | views/controls/combobox/native_combobox_views.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/views/widget/native_widget_win.h" 5 #include "ui/views/widget/native_widget_win.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/system_monitor/system_monitor.h" 8 #include "base/system_monitor/system_monitor.h"
9 #include "ui/base/view_prop.h" 9 #include "ui/base/view_prop.h"
10 #include "ui/base/win/hwnd_util.h" 10 #include "ui/base/win/hwnd_util.h"
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 SetMsgHandled(FALSE); 444 SetMsgHandled(FALSE);
445 return 0; 445 return 0;
446 } 446 }
447 447
448 void NativeWidgetWin::OnPaint(HDC dc) { 448 void NativeWidgetWin::OnPaint(HDC dc) {
449 if (IsLayeredWindow()) { 449 if (IsLayeredWindow()) {
450 // We need to clip to the dirty rect ourselves. 450 // We need to clip to the dirty rect ourselves.
451 window_contents_->save(SkCanvas::kClip_SaveFlag); 451 window_contents_->save(SkCanvas::kClip_SaveFlag);
452 RECT r; 452 RECT r;
453 GetUpdateRect(hwnd(), &r, FALSE); 453 GetUpdateRect(hwnd(), &r, FALSE);
454 window_contents_->ClipRectInt(r.left, r.top, r.right - r.left, 454 window_contents_->ClipRectInt(gfx::Rect(r));
455 r.bottom - r.top);
456 listener_->OnPaint(window_contents_.get()); 455 listener_->OnPaint(window_contents_.get());
457 window_contents_->restore(); 456 window_contents_->restore();
458 457
459 RECT wr; 458 RECT wr;
460 GetWindowRect(hwnd(), &wr); 459 GetWindowRect(hwnd(), &wr);
461 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; 460 SIZE size = {wr.right - wr.left, wr.bottom - wr.top};
462 POINT position = {wr.left, wr.top}; 461 POINT position = {wr.left, wr.top};
463 HDC dib_dc = window_contents_->BeginPlatformPaint(); 462 HDC dib_dc = window_contents_->BeginPlatformPaint();
464 POINT zero = {0, 0}; 463 POINT zero = {0, 0};
465 BLENDFUNCTION blend = {AC_SRC_OVER, 0, 125, AC_SRC_ALPHA}; 464 BLENDFUNCTION blend = {AC_SRC_OVER, 0, 125, AC_SRC_ALPHA};
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 if (parent_widget) { 660 if (parent_widget) {
662 widget = parent_widget; 661 widget = parent_widget;
663 parent_hwnd = ::GetAncestor(parent_hwnd, GA_PARENT); 662 parent_hwnd = ::GetAncestor(parent_hwnd, GA_PARENT);
664 } 663 }
665 } while (parent_hwnd != NULL && parent_widget != NULL); 664 } while (parent_hwnd != NULL && parent_widget != NULL);
666 665
667 return widget; 666 return widget;
668 } 667 }
669 668
670 } // namespace ui 669 } // namespace ui
OLDNEW
« no previous file with comments | « ui/views/view.cc ('k') | views/controls/combobox/native_combobox_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698