| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/mus/frame/custom_frame_view_mus.h" | 5 #include "ash/mus/frame/custom_frame_view_mus.h" |
| 6 | 6 |
| 7 #include "ui/compositor/paint_cache.h" | 7 #include "ui/compositor/paint_cache.h" |
| 8 #include "ui/compositor/paint_recorder.h" | 8 #include "ui/compositor/paint_recorder.h" |
| 9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 namespace mus { | 12 namespace mus { |
| 13 | 13 |
| 14 CustomFrameViewMus::CustomFrameViewMus( | 14 CustomFrameViewMus::CustomFrameViewMus( |
| 15 views::Widget* widget, | 15 views::Widget* widget, |
| 16 ImmersiveFullscreenControllerDelegate* immersive_delegate, | 16 ImmersiveFullscreenControllerDelegate* immersive_delegate, |
| 17 bool enable_immersive) | 17 bool enable_immersive) |
| 18 : CustomFrameViewAsh(widget, immersive_delegate, enable_immersive) {} | 18 : CustomFrameViewAsh(widget, immersive_delegate, enable_immersive) {} |
| 19 | 19 |
| 20 CustomFrameViewMus::~CustomFrameViewMus() {} | 20 CustomFrameViewMus::~CustomFrameViewMus() {} |
| 21 | 21 |
| 22 void CustomFrameViewMus::OnPaint(gfx::Canvas* canvas) { | 22 void CustomFrameViewMus::OnPaint(gfx::Canvas* canvas) { |
| 23 canvas->Save(); | 23 canvas->Save(); |
| 24 CustomFrameViewAsh::OnPaint(canvas); | 24 CustomFrameViewAsh::OnPaint(canvas); |
| 25 canvas->Restore(); | 25 canvas->Restore(); |
| 26 | 26 |
| 27 // The client app draws the client area. Make ours totally transparent so | 27 // The client app draws the client area. Make ours totally transparent so |
| 28 // we only see the client app's client area. | 28 // we only see the client app's client area. |
| 29 canvas->FillRect(GetBoundsForClientView(), SK_ColorBLACK, | 29 canvas->FillRect(GetBoundsForClientView(), SK_ColorBLACK, |
| 30 SkXfermode::kClear_Mode); | 30 SkBlendMode::kClear); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void CustomFrameViewMus::PaintChildren(const ui::PaintContext& context) { | 33 void CustomFrameViewMus::PaintChildren(const ui::PaintContext& context) { |
| 34 CustomFrameViewAsh::PaintChildren(context); | 34 CustomFrameViewAsh::PaintChildren(context); |
| 35 // The client app draws the client area. Make ours totally transparent so | 35 // The client app draws the client area. Make ours totally transparent so |
| 36 // we only see the client apps client area. | 36 // we only see the client apps client area. |
| 37 ui::PaintRecorder recorder(context, size(), &paint_cache_); | 37 ui::PaintRecorder recorder(context, size(), &paint_cache_); |
| 38 recorder.canvas()->FillRect(GetBoundsForClientView(), SK_ColorBLACK, | 38 recorder.canvas()->FillRect(GetBoundsForClientView(), SK_ColorBLACK, |
| 39 SkXfermode::kClear_Mode); | 39 SkBlendMode::kClear); |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace mus | 42 } // namespace mus |
| 43 } // namespace ash | 43 } // namespace ash |
| OLD | NEW |