| 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 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 layered_window_invalid_rect_.y(), | 1111 layered_window_invalid_rect_.y(), |
| 1112 layered_window_invalid_rect_.width(), | 1112 layered_window_invalid_rect_.width(), |
| 1113 layered_window_invalid_rect_.height()); | 1113 layered_window_invalid_rect_.height()); |
| 1114 GetRootView()->Paint(layered_window_contents_.get()); | 1114 GetRootView()->Paint(layered_window_contents_.get()); |
| 1115 layered_window_contents_->restore(); | 1115 layered_window_contents_->restore(); |
| 1116 | 1116 |
| 1117 RECT wr; | 1117 RECT wr; |
| 1118 GetWindowRect(&wr); | 1118 GetWindowRect(&wr); |
| 1119 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; | 1119 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; |
| 1120 POINT position = {wr.left, wr.top}; | 1120 POINT position = {wr.left, wr.top}; |
| 1121 HDC dib_dc = layered_window_contents_->getTopPlatformDevice().getBitmapDC(); | 1121 HDC dib_dc = layered_window_contents_->beginPlatformPaint(); |
| 1122 POINT zero = {0, 0}; | 1122 POINT zero = {0, 0}; |
| 1123 BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA}; | 1123 BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA}; |
| 1124 UpdateLayeredWindow(hwnd(), NULL, &position, &size, dib_dc, &zero, | 1124 UpdateLayeredWindow(hwnd(), NULL, &position, &size, dib_dc, &zero, |
| 1125 RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA); | 1125 RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA); |
| 1126 layered_window_invalid_rect_.SetRect(0, 0, 0, 0); | 1126 layered_window_invalid_rect_.SetRect(0, 0, 0, 0); |
| 1127 layered_window_contents_->endPlatformPaint(); |
| 1127 } | 1128 } |
| 1128 | 1129 |
| 1129 void WidgetWin::ClientAreaSizeChanged() { | 1130 void WidgetWin::ClientAreaSizeChanged() { |
| 1130 RECT r; | 1131 RECT r; |
| 1131 GetClientRect(&r); | 1132 GetClientRect(&r); |
| 1132 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), | 1133 gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)), |
| 1133 std::max(0, static_cast<int>(r.bottom - r.top))); | 1134 std::max(0, static_cast<int>(r.bottom - r.top))); |
| 1134 delegate_->OnSizeChanged(s); | 1135 delegate_->OnSizeChanged(s); |
| 1135 if (use_layered_buffer_) { | 1136 if (use_layered_buffer_) { |
| 1136 layered_window_contents_.reset( | 1137 layered_window_contents_.reset( |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 | 1271 |
| 1271 // And now, notify them that they have a brand new parent. | 1272 // And now, notify them that they have a brand new parent. |
| 1272 for (NativeWidgets::iterator it = widgets.begin(); | 1273 for (NativeWidgets::iterator it = widgets.begin(); |
| 1273 it != widgets.end(); ++it) { | 1274 it != widgets.end(); ++it) { |
| 1274 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, | 1275 (*it)->GetWidget()->NotifyNativeViewHierarchyChanged(true, |
| 1275 new_parent); | 1276 new_parent); |
| 1276 } | 1277 } |
| 1277 } | 1278 } |
| 1278 | 1279 |
| 1279 } // namespace views | 1280 } // namespace views |
| OLD | NEW |