OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/surface.h" | 5 #include "components/exo/surface.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 &local_point); | 175 &local_point); |
176 return surface->HitTestRect(gfx::Rect(local_point, gfx::Size(1, 1))); | 176 return surface->HitTestRect(gfx::Rect(local_point, gfx::Size(1, 1))); |
177 } | 177 } |
178 | 178 |
179 private: | 179 private: |
180 DISALLOW_COPY_AND_ASSIGN(CustomWindowTargeter); | 180 DISALLOW_COPY_AND_ASSIGN(CustomWindowTargeter); |
181 }; | 181 }; |
182 | 182 |
183 } // namespace | 183 } // namespace |
184 | 184 |
185 // static | |
186 const char Surface::kSurfaceWindowName[] = "ExoSurface"; | |
187 | |
185 //////////////////////////////////////////////////////////////////////////////// | 188 //////////////////////////////////////////////////////////////////////////////// |
186 // Surface, public: | 189 // Surface, public: |
187 | 190 |
188 Surface::Surface() : window_(new aura::Window(new CustomWindowDelegate(this))) { | 191 Surface::Surface() : window_(new aura::Window(new CustomWindowDelegate(this))) { |
189 window_->SetType(aura::client::WINDOW_TYPE_CONTROL); | 192 window_->SetType(aura::client::WINDOW_TYPE_CONTROL); |
190 window_->SetName("ExoSurface"); | 193 window_->SetName(kSurfaceWindowName); |
reveman
2017/06/21 15:16:36
We're going to remove |window_| soon to support MU
yoshiki
2017/06/21 16:13:12
Although I'm not sure how you remove |window_|, th
reveman
2017/06/21 16:22:24
Each surface will no longer have a window. Only th
| |
191 window_->SetProperty(kSurfaceKey, this); | 194 window_->SetProperty(kSurfaceKey, this); |
192 window_->Init(ui::LAYER_SOLID_COLOR); | 195 window_->Init(ui::LAYER_SOLID_COLOR); |
193 window_->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter)); | 196 window_->SetEventTargeter(base::WrapUnique(new CustomWindowTargeter)); |
194 window_->set_owned_by_parent(false); | 197 window_->set_owned_by_parent(false); |
195 window_->AddObserver(this); | 198 window_->AddObserver(this); |
196 aura::Env::GetInstance()->context_factory()->AddObserver(this); | 199 aura::Env::GetInstance()->context_factory()->AddObserver(this); |
197 compositor_frame_sink_holder_ = base::MakeUnique<CompositorFrameSinkHolder>( | 200 compositor_frame_sink_holder_ = base::MakeUnique<CompositorFrameSinkHolder>( |
198 this, window_->CreateCompositorFrameSink()); | 201 this, window_->CreateCompositorFrameSink()); |
199 } | 202 } |
200 | 203 |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
886 render_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>(); | 889 render_pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>(); |
887 solid_quad->SetNew(quad_state, quad_rect, quad_rect, SK_ColorBLACK, false); | 890 solid_quad->SetNew(quad_state, quad_rect, quad_rect, SK_ColorBLACK, false); |
888 } | 891 } |
889 | 892 |
890 frame.render_pass_list.push_back(std::move(render_pass)); | 893 frame.render_pass_list.push_back(std::move(render_pass)); |
891 compositor_frame_sink_holder_->GetCompositorFrameSink() | 894 compositor_frame_sink_holder_->GetCompositorFrameSink() |
892 ->SubmitCompositorFrame(std::move(frame)); | 895 ->SubmitCompositorFrame(std::move(frame)); |
893 } | 896 } |
894 | 897 |
895 } // namespace exo | 898 } // namespace exo |
OLD | NEW |