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