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 apps client area. | |
James Cook
2016/08/24 17:00:32
super nit: apps -> app's
sky
2016/08/24 19:23:28
Done.
| |
29 canvas->FillRect(GetBoundsForClientView(), SK_ColorBLACK, | |
James Cook
2016/08/24 17:00:32
Dumb question: Why is this SK_ColorBLACK? How does
sky
2016/08/24 19:23:29
Not a dumb question. This should be kClear_Mode. F
| |
30 SkXfermode::kSrc_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::kSrc_Mode); | |
40 } | |
41 | |
42 } // namespace mus | |
43 } // namespace ash | |
OLD | NEW |