| 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 #include <utility> | 10 #include <utility> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "content/browser/compositor/gl_helper.h" | 46 #include "content/browser/compositor/gl_helper.h" |
| 47 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 47 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 48 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 48 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 49 #include "content/browser/gpu/compositor_util.h" | 49 #include "content/browser/gpu/compositor_util.h" |
| 50 #include "content/browser/gpu/gpu_surface_tracker.h" | 50 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 51 #include "content/browser/renderer_host/render_widget_host_impl.h" | 51 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 52 #include "content/common/gpu/client/command_buffer_proxy_impl.h" | 52 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
| 53 #include "content/common/gpu/client/context_provider_command_buffer.h" | 53 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 54 #include "content/common/gpu/client/gpu_channel_host.h" | 54 #include "content/common/gpu/client/gpu_channel_host.h" |
| 55 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 55 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 56 #include "content/common/gpu/gpu_process_launch_causes.h" | |
| 57 #include "content/common/host_shared_bitmap_manager.h" | 56 #include "content/common/host_shared_bitmap_manager.h" |
| 58 #include "content/public/browser/android/compositor.h" | 57 #include "content/public/browser/android/compositor.h" |
| 59 #include "content/public/browser/android/compositor_client.h" | 58 #include "content/public/browser/android/compositor_client.h" |
| 60 #include "content/public/common/content_switches.h" | 59 #include "content/public/common/content_switches.h" |
| 61 #include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h" | 60 #include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h" |
| 62 #include "gpu/command_buffer/client/context_support.h" | 61 #include "gpu/command_buffer/client/context_support.h" |
| 63 #include "gpu/command_buffer/client/gles2_interface.h" | 62 #include "gpu/command_buffer/client/gles2_interface.h" |
| 63 #include "gpu/ipc/common/gpu_process_launch_causes.h" |
| 64 #include "third_party/khronos/GLES2/gl2.h" | 64 #include "third_party/khronos/GLES2/gl2.h" |
| 65 #include "third_party/khronos/GLES2/gl2ext.h" | 65 #include "third_party/khronos/GLES2/gl2ext.h" |
| 66 #include "third_party/skia/include/core/SkMallocPixelRef.h" | 66 #include "third_party/skia/include/core/SkMallocPixelRef.h" |
| 67 #include "ui/android/window_android.h" | 67 #include "ui/android/window_android.h" |
| 68 #include "ui/gfx/android/device_display_info.h" | 68 #include "ui/gfx/android/device_display_info.h" |
| 69 #include "ui/gfx/swap_result.h" | 69 #include "ui/gfx/swap_result.h" |
| 70 | 70 |
| 71 namespace content { | 71 namespace content { |
| 72 | 72 |
| 73 namespace { | 73 namespace { |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 defined(SYZYASAN) || defined(CYGPROFILE_INSTRUMENTATION) | 465 defined(SYZYASAN) || defined(CYGPROFILE_INSTRUMENTATION) |
| 466 const int64_t kGpuChannelTimeoutInSeconds = 40; | 466 const int64_t kGpuChannelTimeoutInSeconds = 40; |
| 467 #else | 467 #else |
| 468 const int64_t kGpuChannelTimeoutInSeconds = 10; | 468 const int64_t kGpuChannelTimeoutInSeconds = 10; |
| 469 #endif | 469 #endif |
| 470 | 470 |
| 471 BrowserGpuChannelHostFactory* factory = | 471 BrowserGpuChannelHostFactory* factory = |
| 472 BrowserGpuChannelHostFactory::instance(); | 472 BrowserGpuChannelHostFactory::instance(); |
| 473 if (!factory->GetGpuChannel() || factory->GetGpuChannel()->IsLost()) { | 473 if (!factory->GetGpuChannel() || factory->GetGpuChannel()->IsLost()) { |
| 474 factory->EstablishGpuChannel( | 474 factory->EstablishGpuChannel( |
| 475 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE, | 475 gpu:: |
| 476 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ
E, |
| 476 base::Bind(&CompositorImpl::OnGpuChannelEstablished, | 477 base::Bind(&CompositorImpl::OnGpuChannelEstablished, |
| 477 weak_factory_.GetWeakPtr())); | 478 weak_factory_.GetWeakPtr())); |
| 478 establish_gpu_channel_timeout_.Start( | 479 establish_gpu_channel_timeout_.Start( |
| 479 FROM_HERE, base::TimeDelta::FromSeconds(kGpuChannelTimeoutInSeconds), | 480 FROM_HERE, base::TimeDelta::FromSeconds(kGpuChannelTimeoutInSeconds), |
| 480 this, &CompositorImpl::OnGpuChannelTimeout); | 481 this, &CompositorImpl::OnGpuChannelTimeout); |
| 481 return; | 482 return; |
| 482 } | 483 } |
| 483 | 484 |
| 484 CreateOutputSurface(); | 485 CreateOutputSurface(); |
| 485 } | 486 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 | 627 |
| 627 void CompositorImpl::SetNeedsAnimate() { | 628 void CompositorImpl::SetNeedsAnimate() { |
| 628 needs_animate_ = true; | 629 needs_animate_ = true; |
| 629 if (!host_->visible()) | 630 if (!host_->visible()) |
| 630 return; | 631 return; |
| 631 | 632 |
| 632 host_->SetNeedsAnimate(); | 633 host_->SetNeedsAnimate(); |
| 633 } | 634 } |
| 634 | 635 |
| 635 } // namespace content | 636 } // namespace content |
| OLD | NEW |