OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/compositor_impl_android.h" | 5 #include "content/browser/renderer_host/compositor_impl_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 private: | 172 private: |
173 // Overridden from base::DelegateSimpleThread::Delegate: | 173 // Overridden from base::DelegateSimpleThread::Delegate: |
174 void Run() override { cc::TaskGraphRunner::Run(); } | 174 void Run() override { cc::TaskGraphRunner::Run(); } |
175 | 175 |
176 base::DelegateSimpleThread worker_thread_; | 176 base::DelegateSimpleThread worker_thread_; |
177 }; | 177 }; |
178 | 178 |
179 base::LazyInstance<SingleThreadTaskGraphRunner> g_task_graph_runner = | 179 base::LazyInstance<SingleThreadTaskGraphRunner> g_task_graph_runner = |
180 LAZY_INSTANCE_INITIALIZER; | 180 LAZY_INSTANCE_INITIALIZER; |
181 | 181 |
182 base::LazyInstance<cc::LayerSettings> g_layer_settings = | |
183 LAZY_INSTANCE_INITIALIZER; | |
184 | |
185 } // anonymous namespace | 182 } // anonymous namespace |
186 | 183 |
187 // static | 184 // static |
188 Compositor* Compositor::Create(CompositorClient* client, | 185 Compositor* Compositor::Create(CompositorClient* client, |
189 gfx::NativeWindow root_window) { | 186 gfx::NativeWindow root_window) { |
190 return client ? new CompositorImpl(client, root_window) : NULL; | 187 return client ? new CompositorImpl(client, root_window) : NULL; |
191 } | 188 } |
192 | 189 |
193 // static | 190 // static |
194 void Compositor::Initialize() { | 191 void Compositor::Initialize() { |
195 DCHECK(!CompositorImpl::IsInitialized()); | 192 DCHECK(!CompositorImpl::IsInitialized()); |
196 g_initialized = true; | 193 g_initialized = true; |
197 g_use_surface_manager = UseSurfacesEnabled(); | 194 g_use_surface_manager = UseSurfacesEnabled(); |
198 } | 195 } |
199 | 196 |
200 // static | 197 // static |
201 const cc::LayerSettings& Compositor::LayerSettings() { | 198 const cc::LayerSettings& Compositor::LayerSettings() { |
202 return g_layer_settings.Get(); | 199 return ui::WindowAndroidCompositor::LayerSettings(); |
203 } | 200 } |
204 | 201 |
205 // static | 202 // static |
206 void Compositor::SetLayerSettings(const cc::LayerSettings& settings) { | 203 void Compositor::SetLayerSettings(const cc::LayerSettings& settings) { |
207 g_layer_settings.Get() = settings; | 204 ui::WindowAndroidCompositor::SetLayerSettings(settings); |
208 } | 205 } |
209 | 206 |
210 // static | 207 // static |
211 bool CompositorImpl::IsInitialized() { | 208 bool CompositorImpl::IsInitialized() { |
212 return g_initialized; | 209 return g_initialized; |
213 } | 210 } |
214 | 211 |
215 // static | 212 // static |
216 cc::SurfaceManager* CompositorImpl::GetSurfaceManager() { | 213 cc::SurfaceManager* CompositorImpl::GetSurfaceManager() { |
217 if (!g_use_surface_manager) | 214 if (!g_use_surface_manager) |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 | 796 |
800 void CompositorImpl::SetNeedsAnimate() { | 797 void CompositorImpl::SetNeedsAnimate() { |
801 needs_animate_ = true; | 798 needs_animate_ = true; |
802 if (!host_->visible()) | 799 if (!host_->visible()) |
803 return; | 800 return; |
804 | 801 |
805 host_->SetNeedsAnimate(); | 802 host_->SetNeedsAnimate(); |
806 } | 803 } |
807 | 804 |
808 } // namespace content | 805 } // namespace content |
OLD | NEW |