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

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

Issue 6677142: rename getBitmapDC to beginPlatformPaint and add calls to endPlatformPaint (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 8 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 | « ui/gfx/blit.cc ('k') | views/widget/widget_win.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 "ui/base/system_monitor/system_monitor.h" 8 #include "ui/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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(r.left, r.top, r.right - r.left,
455 r.bottom - r.top); 455 r.bottom - r.top);
456 listener_->OnPaint(window_contents_.get()); 456 listener_->OnPaint(window_contents_.get());
457 window_contents_->restore(); 457 window_contents_->restore();
458 458
459 RECT wr; 459 RECT wr;
460 GetWindowRect(hwnd(), &wr); 460 GetWindowRect(hwnd(), &wr);
461 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; 461 SIZE size = {wr.right - wr.left, wr.bottom - wr.top};
462 POINT position = {wr.left, wr.top}; 462 POINT position = {wr.left, wr.top};
463 HDC dib_dc = window_contents_->getTopPlatformDevice().getBitmapDC(); 463 HDC dib_dc = window_contents_->beginPlatformPaint();
464 POINT zero = {0, 0}; 464 POINT zero = {0, 0};
465 BLENDFUNCTION blend = {AC_SRC_OVER, 0, 125, AC_SRC_ALPHA}; 465 BLENDFUNCTION blend = {AC_SRC_OVER, 0, 125, AC_SRC_ALPHA};
466 UpdateLayeredWindow(hwnd(), NULL, &position, &size, dib_dc, &zero, 466 UpdateLayeredWindow(hwnd(), NULL, &position, &size, dib_dc, &zero,
467 RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA); 467 RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA);
468 window_contents_->endPlatformPaint();
468 } else { 469 } else {
469 scoped_ptr<gfx::CanvasPaint> canvas( 470 scoped_ptr<gfx::CanvasPaint> canvas(
470 gfx::CanvasPaint::CreateCanvasPaint(hwnd())); 471 gfx::CanvasPaint::CreateCanvasPaint(hwnd()));
471 listener_->OnPaint(canvas->AsCanvas()); 472 listener_->OnPaint(canvas->AsCanvas());
472 } 473 }
473 } 474 }
474 475
475 LRESULT NativeWidgetWin::OnPowerBroadcast(DWORD power_event, DWORD data) { 476 LRESULT NativeWidgetWin::OnPowerBroadcast(DWORD power_event, DWORD data) {
476 SystemMonitor* monitor = SystemMonitor::Get(); 477 SystemMonitor* monitor = SystemMonitor::Get();
477 if (monitor) 478 if (monitor)
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 if (parent_widget) { 663 if (parent_widget) {
663 widget = parent_widget; 664 widget = parent_widget;
664 parent_hwnd = ::GetAncestor(parent_hwnd, GA_PARENT); 665 parent_hwnd = ::GetAncestor(parent_hwnd, GA_PARENT);
665 } 666 }
666 } while (parent_hwnd != NULL && parent_widget != NULL); 667 } while (parent_hwnd != NULL && parent_widget != NULL);
667 668
668 return widget; 669 return widget;
669 } 670 }
670 671
671 } // namespace ui 672 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/blit.cc ('k') | views/widget/widget_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698