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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 BrowserGpuChannelHostFactory* factory = | 597 BrowserGpuChannelHostFactory* factory = |
598 BrowserGpuChannelHostFactory::instance(); | 598 BrowserGpuChannelHostFactory::instance(); |
599 // This channel might be lost (and even if it isn't right now, it might | 599 // This channel might be lost (and even if it isn't right now, it might |
600 // still get marked as lost from the IO thread, at any point in time really). | 600 // still get marked as lost from the IO thread, at any point in time really). |
601 // But from here on just try and always lead to either | 601 // But from here on just try and always lead to either |
602 // DidInitializeOutputSurface() or DidFailToInitializeOutputSurface(). | 602 // DidInitializeOutputSurface() or DidFailToInitializeOutputSurface(). |
603 scoped_refptr<GpuChannelHost> gpu_channel_host(factory->GetGpuChannel()); | 603 scoped_refptr<GpuChannelHost> gpu_channel_host(factory->GetGpuChannel()); |
604 scoped_refptr<ContextProviderCommandBuffer> context_provider( | 604 scoped_refptr<ContextProviderCommandBuffer> context_provider( |
605 ContextProviderCommandBuffer::Create( | 605 ContextProviderCommandBuffer::Create( |
606 CreateGpuProcessViewContext(gpu_channel_host, attrs, surface_id_), | 606 CreateGpuProcessViewContext(gpu_channel_host, attrs, surface_id_), |
607 "BrowserCompositor")); | 607 BROWSER_COMPOSITOR_ONSCREEN_CONTEXT)); |
608 DCHECK(context_provider.get()); | 608 DCHECK(context_provider.get()); |
609 | 609 |
610 scoped_ptr<cc::OutputSurface> real_output_surface( | 610 scoped_ptr<cc::OutputSurface> real_output_surface( |
611 new OutputSurfaceWithoutParent(context_provider, | 611 new OutputSurfaceWithoutParent(context_provider, |
612 weak_factory_.GetWeakPtr())); | 612 weak_factory_.GetWeakPtr())); |
613 | 613 |
614 cc::SurfaceManager* manager = GetSurfaceManager(); | 614 cc::SurfaceManager* manager = GetSurfaceManager(); |
615 if (manager) { | 615 if (manager) { |
616 display_client_.reset(new cc::OnscreenDisplayClient( | 616 display_client_.reset(new cc::OnscreenDisplayClient( |
617 real_output_surface.Pass(), manager, HostSharedBitmapManager::current(), | 617 real_output_surface.Pass(), manager, HostSharedBitmapManager::current(), |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 | 721 |
722 void CompositorImpl::SetNeedsAnimate() { | 722 void CompositorImpl::SetNeedsAnimate() { |
723 needs_animate_ = true; | 723 needs_animate_ = true; |
724 if (!host_) | 724 if (!host_) |
725 return; | 725 return; |
726 | 726 |
727 host_->SetNeedsAnimate(); | 727 host_->SetNeedsAnimate(); |
728 } | 728 } |
729 | 729 |
730 } // namespace content | 730 } // namespace content |
OLD | NEW |