| 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 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2315 } | 2315 } |
| 2316 } | 2316 } |
| 2317 } | 2317 } |
| 2318 | 2318 |
| 2319 void NativeWidgetWin::RedrawLayeredWindowContents() { | 2319 void NativeWidgetWin::RedrawLayeredWindowContents() { |
| 2320 if (invalid_rect_.IsEmpty()) | 2320 if (invalid_rect_.IsEmpty()) |
| 2321 return; | 2321 return; |
| 2322 | 2322 |
| 2323 // We need to clip to the dirty rect ourselves. | 2323 // We need to clip to the dirty rect ourselves. |
| 2324 layered_window_contents_->sk_canvas()->save(SkCanvas::kClip_SaveFlag); | 2324 layered_window_contents_->sk_canvas()->save(SkCanvas::kClip_SaveFlag); |
| 2325 layered_window_contents_->ClipRectInt(invalid_rect_.x(), | 2325 layered_window_contents_->ClipRectInt(invalid_rect_); |
| 2326 invalid_rect_.y(), | |
| 2327 invalid_rect_.width(), | |
| 2328 invalid_rect_.height()); | |
| 2329 GetWidget()->GetRootView()->Paint(layered_window_contents_.get()); | 2326 GetWidget()->GetRootView()->Paint(layered_window_contents_.get()); |
| 2330 layered_window_contents_->sk_canvas()->restore(); | 2327 layered_window_contents_->sk_canvas()->restore(); |
| 2331 | 2328 |
| 2332 RECT wr; | 2329 RECT wr; |
| 2333 GetWindowRect(&wr); | 2330 GetWindowRect(&wr); |
| 2334 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; | 2331 SIZE size = {wr.right - wr.left, wr.bottom - wr.top}; |
| 2335 POINT position = {wr.left, wr.top}; | 2332 POINT position = {wr.left, wr.top}; |
| 2336 HDC dib_dc = skia::BeginPlatformPaint(layered_window_contents_->sk_canvas()); | 2333 HDC dib_dc = skia::BeginPlatformPaint(layered_window_contents_->sk_canvas()); |
| 2337 POINT zero = {0, 0}; | 2334 POINT zero = {0, 0}; |
| 2338 BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA}; | 2335 BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA}; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2625 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2622 return (GetKeyState(VK_LBUTTON) & 0x80) || |
| 2626 (GetKeyState(VK_RBUTTON) & 0x80) || | 2623 (GetKeyState(VK_RBUTTON) & 0x80) || |
| 2627 (GetKeyState(VK_MBUTTON) & 0x80) || | 2624 (GetKeyState(VK_MBUTTON) & 0x80) || |
| 2628 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2625 (GetKeyState(VK_XBUTTON1) & 0x80) || |
| 2629 (GetKeyState(VK_XBUTTON2) & 0x80); | 2626 (GetKeyState(VK_XBUTTON2) & 0x80); |
| 2630 } | 2627 } |
| 2631 | 2628 |
| 2632 } // namespace internal | 2629 } // namespace internal |
| 2633 | 2630 |
| 2634 } // namespace views | 2631 } // namespace views |
| OLD | NEW |