OLD | NEW |
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 "views/widget/native_widget_win.h" | 5 #include "views/widget/native_widget_win.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/system_monitor/system_monitor.h" | 10 #include "base/system_monitor/system_monitor.h" |
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 invalid_rect_.y(), | 1113 invalid_rect_.y(), |
1114 invalid_rect_.width(), | 1114 invalid_rect_.width(), |
1115 invalid_rect_.height()); | 1115 invalid_rect_.height()); |
1116 GetWidget()->GetRootView()->Paint(layered_window_contents_.get()); | 1116 GetWidget()->GetRootView()->Paint(layered_window_contents_.get()); |
1117 layered_window_contents_->restore(); | 1117 layered_window_contents_->restore(); |
1118 | 1118 |
1119 RECT wr; | 1119 RECT wr; |
1120 GetWindowRect(&wr); | 1120 GetWindowRect(&wr); |
1121 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; | 1121 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; |
1122 POINT position = {wr.left, wr.top}; | 1122 POINT position = {wr.left, wr.top}; |
1123 HDC dib_dc = layered_window_contents_->beginPlatformPaint(); | 1123 HDC dib_dc = skia::BeginPlatformPaint(layered_window_contents_.get()); |
1124 POINT zero = {0, 0}; | 1124 POINT zero = {0, 0}; |
1125 BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA}; | 1125 BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA}; |
1126 UpdateLayeredWindow(hwnd(), NULL, &position, &size, dib_dc, &zero, | 1126 UpdateLayeredWindow(hwnd(), NULL, &position, &size, dib_dc, &zero, |
1127 RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA); | 1127 RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA); |
1128 invalid_rect_.SetRect(0, 0, 0, 0); | 1128 invalid_rect_.SetRect(0, 0, 0, 0); |
1129 layered_window_contents_->endPlatformPaint(); | 1129 skia::EndPlatformPaint(layered_window_contents_.get()); |
1130 } | 1130 } |
1131 | 1131 |
1132 void NativeWidgetWin::ClientAreaSizeChanged() { | 1132 void NativeWidgetWin::ClientAreaSizeChanged() { |
1133 RECT r; | 1133 RECT r; |
1134 Window* window = GetWidget()->GetContainingWindow(); | 1134 Window* window = GetWidget()->GetContainingWindow(); |
1135 if (IsZoomed() || (window && window->ShouldUseNativeFrame())) | 1135 if (IsZoomed() || (window && window->ShouldUseNativeFrame())) |
1136 GetClientRect(&r); | 1136 GetClientRect(&r); |
1137 else | 1137 else |
1138 GetWindowRect(&r); | 1138 GetWindowRect(&r); |
1139 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), | 1139 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 | 1296 |
1297 // And now, notify them that they have a brand new parent. | 1297 // And now, notify them that they have a brand new parent. |
1298 for (NativeWidgets::iterator it = widgets.begin(); | 1298 for (NativeWidgets::iterator it = widgets.begin(); |
1299 it != widgets.end(); ++it) { | 1299 it != widgets.end(); ++it) { |
1300 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, | 1300 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, |
1301 new_parent); | 1301 new_parent); |
1302 } | 1302 } |
1303 } | 1303 } |
1304 | 1304 |
1305 } // namespace views | 1305 } // namespace views |
OLD | NEW |