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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 gfx::NativeWindow root_window) | 231 gfx::NativeWindow root_window) |
232 : root_layer_(cc::Layer::Create(Compositor::LayerSettings())), | 232 : root_layer_(cc::Layer::Create(Compositor::LayerSettings())), |
233 resource_manager_(&ui_resource_provider_), | 233 resource_manager_(&ui_resource_provider_), |
234 surface_id_allocator_(GetSurfaceManager() ? CreateSurfaceIdAllocator() | 234 surface_id_allocator_(GetSurfaceManager() ? CreateSurfaceIdAllocator() |
235 : nullptr), | 235 : nullptr), |
236 has_transparent_background_(false), | 236 has_transparent_background_(false), |
237 device_scale_factor_(1), | 237 device_scale_factor_(1), |
238 window_(NULL), | 238 window_(NULL), |
239 surface_id_(0), | 239 surface_id_(0), |
240 client_(client), | 240 client_(client), |
241 root_window_(root_window), | 241 root_window_((ui::WindowAndroid*)root_window), |
242 did_post_swapbuffers_(false), | 242 did_post_swapbuffers_(false), |
243 ignore_schedule_composite_(false), | 243 ignore_schedule_composite_(false), |
244 needs_composite_(false), | 244 needs_composite_(false), |
245 needs_animate_(false), | 245 needs_animate_(false), |
246 will_composite_immediately_(false), | 246 will_composite_immediately_(false), |
247 composite_on_vsync_trigger_(DO_NOT_COMPOSITE), | 247 composite_on_vsync_trigger_(DO_NOT_COMPOSITE), |
248 pending_swapbuffers_(0U), | 248 pending_swapbuffers_(0U), |
249 num_successive_context_creation_failures_(0), | 249 num_successive_context_creation_failures_(0), |
250 output_surface_request_pending_(false), | 250 output_surface_request_pending_(false), |
251 weak_factory_(this) { | 251 weak_factory_(this) { |
252 DCHECK(client); | 252 DCHECK(client); |
253 DCHECK(root_window); | 253 DCHECK(root_window); |
254 root_window->AttachCompositor(this); | 254 root_window_->AttachCompositor(this); |
255 } | 255 } |
256 | 256 |
257 CompositorImpl::~CompositorImpl() { | 257 CompositorImpl::~CompositorImpl() { |
258 root_window_->DetachCompositor(); | 258 root_window_->DetachCompositor(); |
259 // Clean-up any surface references. | 259 // Clean-up any surface references. |
260 SetSurface(NULL); | 260 SetSurface(NULL); |
261 } | 261 } |
262 | 262 |
263 void CompositorImpl::PostComposite(CompositingTrigger trigger) { | 263 void CompositorImpl::PostComposite(CompositingTrigger trigger) { |
264 DCHECK(needs_composite_); | 264 DCHECK(needs_composite_); |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 | 786 |
787 void CompositorImpl::SetNeedsAnimate() { | 787 void CompositorImpl::SetNeedsAnimate() { |
788 needs_animate_ = true; | 788 needs_animate_ = true; |
789 if (!host_) | 789 if (!host_) |
790 return; | 790 return; |
791 | 791 |
792 host_->SetNeedsAnimate(); | 792 host_->SetNeedsAnimate(); |
793 } | 793 } |
794 | 794 |
795 } // namespace content | 795 } // namespace content |
OLD | NEW |