| 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 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 return allocator; | 341 return allocator; |
| 342 } | 342 } |
| 343 | 343 |
| 344 // static | 344 // static |
| 345 scoped_refptr<cc::VulkanInProcessContextProvider> | 345 scoped_refptr<cc::VulkanInProcessContextProvider> |
| 346 CompositorImpl::SharedVulkanContextProviderAndroid() { | 346 CompositorImpl::SharedVulkanContextProviderAndroid() { |
| 347 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 347 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 348 switches::kEnableVulkan)) { | 348 switches::kEnableVulkan)) { |
| 349 scoped_refptr<cc::VulkanInProcessContextProvider>* context_provider = | 349 scoped_refptr<cc::VulkanInProcessContextProvider>* context_provider = |
| 350 g_shared_vulkan_context_provider_android_.Pointer(); | 350 g_shared_vulkan_context_provider_android_.Pointer(); |
| 351 if (*context_provider == NULL) | 351 if (!*context_provider) |
| 352 *context_provider = cc::VulkanInProcessContextProvider::Create(); | 352 *context_provider = cc::VulkanInProcessContextProvider::Create(); |
| 353 return *context_provider; | 353 return *context_provider; |
| 354 } | 354 } |
| 355 return nullptr; | 355 return nullptr; |
| 356 } | 356 } |
| 357 | 357 |
| 358 CompositorImpl::CompositorImpl(CompositorClient* client, | 358 CompositorImpl::CompositorImpl(CompositorClient* client, |
| 359 gfx::NativeWindow root_window) | 359 gfx::NativeWindow root_window) |
| 360 : root_layer_(cc::Layer::Create()), | 360 : root_layer_(cc::Layer::Create()), |
| 361 surface_id_allocator_(CreateSurfaceIdAllocator()), | 361 surface_id_allocator_(CreateSurfaceIdAllocator()), |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 void CompositorImpl::SetNeedsAnimate() { | 787 void CompositorImpl::SetNeedsAnimate() { |
| 788 needs_animate_ = true; | 788 needs_animate_ = true; |
| 789 if (!host_->visible()) | 789 if (!host_->visible()) |
| 790 return; | 790 return; |
| 791 | 791 |
| 792 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); | 792 TRACE_EVENT0("compositor", "Compositor::SetNeedsAnimate"); |
| 793 host_->SetNeedsAnimate(); | 793 host_->SetNeedsAnimate(); |
| 794 } | 794 } |
| 795 | 795 |
| 796 } // namespace content | 796 } // namespace content |
| OLD | NEW |