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/widget_win.h" | 5 #include "views/widget/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/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 layered_window_invalid_rect_.y(), | 1089 layered_window_invalid_rect_.y(), |
1090 layered_window_invalid_rect_.width(), | 1090 layered_window_invalid_rect_.width(), |
1091 layered_window_invalid_rect_.height()); | 1091 layered_window_invalid_rect_.height()); |
1092 GetWidget()->GetRootView()->Paint(layered_window_contents_.get()); | 1092 GetWidget()->GetRootView()->Paint(layered_window_contents_.get()); |
1093 layered_window_contents_->restore(); | 1093 layered_window_contents_->restore(); |
1094 | 1094 |
1095 RECT wr; | 1095 RECT wr; |
1096 GetWindowRect(&wr); | 1096 GetWindowRect(&wr); |
1097 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; | 1097 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; |
1098 POINT position = {wr.left, wr.top}; | 1098 POINT position = {wr.left, wr.top}; |
1099 HDC dib_dc = layered_window_contents_->beginPlatformPaint(); | 1099 HDC dib_dc = skia::BeginPlatformPaint(layered_window_contents_.get()); |
1100 POINT zero = {0, 0}; | 1100 POINT zero = {0, 0}; |
1101 BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA}; | 1101 BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA}; |
1102 UpdateLayeredWindow(hwnd(), NULL, &position, &size, dib_dc, &zero, | 1102 UpdateLayeredWindow(hwnd(), NULL, &position, &size, dib_dc, &zero, |
1103 RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA); | 1103 RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA); |
1104 layered_window_invalid_rect_.SetRect(0, 0, 0, 0); | 1104 layered_window_invalid_rect_.SetRect(0, 0, 0, 0); |
1105 layered_window_contents_->endPlatformPaint(); | 1105 skia::EndPlatformPaint(layered_window_contents_.get()); |
1106 } | 1106 } |
1107 | 1107 |
1108 void WidgetWin::ClientAreaSizeChanged() { | 1108 void WidgetWin::ClientAreaSizeChanged() { |
1109 RECT r; | 1109 RECT r; |
1110 Window* window = GetWidget()->GetContainingWindow(); | 1110 Window* window = GetWidget()->GetContainingWindow(); |
1111 if (IsZoomed() || (window && window->ShouldUseNativeFrame())) | 1111 if (IsZoomed() || (window && window->ShouldUseNativeFrame())) |
1112 GetClientRect(&r); | 1112 GetClientRect(&r); |
1113 else | 1113 else |
1114 GetWindowRect(&r); | 1114 GetWindowRect(&r); |
1115 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), | 1115 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 | 1269 |
1270 // And now, notify them that they have a brand new parent. | 1270 // And now, notify them that they have a brand new parent. |
1271 for (NativeWidgets::iterator it = widgets.begin(); | 1271 for (NativeWidgets::iterator it = widgets.begin(); |
1272 it != widgets.end(); ++it) { | 1272 it != widgets.end(); ++it) { |
1273 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, | 1273 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, |
1274 new_parent); | 1274 new_parent); |
1275 } | 1275 } |
1276 } | 1276 } |
1277 | 1277 |
1278 } // namespace views | 1278 } // namespace views |
OLD | NEW |