Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(840)

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 1095893002: gpu: Fix some context lost marking glitches+leaks and add UMA stats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 BrowserGpuChannelHostFactory* factory = 599 BrowserGpuChannelHostFactory* factory =
600 BrowserGpuChannelHostFactory::instance(); 600 BrowserGpuChannelHostFactory::instance();
601 // This channel might be lost (and even if it isn't right now, it might 601 // This channel might be lost (and even if it isn't right now, it might
602 // still get marked as lost from the IO thread, at any point in time really). 602 // still get marked as lost from the IO thread, at any point in time really).
603 // But from here on just try and always lead to either 603 // But from here on just try and always lead to either
604 // DidInitializeOutputSurface() or DidFailToInitializeOutputSurface(). 604 // DidInitializeOutputSurface() or DidFailToInitializeOutputSurface().
605 scoped_refptr<GpuChannelHost> gpu_channel_host(factory->GetGpuChannel()); 605 scoped_refptr<GpuChannelHost> gpu_channel_host(factory->GetGpuChannel());
606 scoped_refptr<ContextProviderCommandBuffer> context_provider( 606 scoped_refptr<ContextProviderCommandBuffer> context_provider(
607 ContextProviderCommandBuffer::Create( 607 ContextProviderCommandBuffer::Create(
608 CreateGpuProcessViewContext(gpu_channel_host, attrs, surface_id_), 608 CreateGpuProcessViewContext(gpu_channel_host, attrs, surface_id_),
609 "BrowserCompositor")); 609 BROWSER_COMPOSITOR_ONSCREEN_CONTEXT));
610 DCHECK(context_provider.get()); 610 DCHECK(context_provider.get());
611 611
612 scoped_ptr<cc::OutputSurface> real_output_surface( 612 scoped_ptr<cc::OutputSurface> real_output_surface(
613 new OutputSurfaceWithoutParent(context_provider, 613 new OutputSurfaceWithoutParent(context_provider,
614 weak_factory_.GetWeakPtr())); 614 weak_factory_.GetWeakPtr()));
615 615
616 cc::SurfaceManager* manager = GetSurfaceManager(); 616 cc::SurfaceManager* manager = GetSurfaceManager();
617 if (manager) { 617 if (manager) {
618 display_client_.reset(new cc::OnscreenDisplayClient( 618 display_client_.reset(new cc::OnscreenDisplayClient(
619 real_output_surface.Pass(), manager, HostSharedBitmapManager::current(), 619 real_output_surface.Pass(), manager, HostSharedBitmapManager::current(),
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 723
724 void CompositorImpl::SetNeedsAnimate() { 724 void CompositorImpl::SetNeedsAnimate() {
725 needs_animate_ = true; 725 needs_animate_ = true;
726 if (!host_) 726 if (!host_)
727 return; 727 return;
728 728
729 host_->SetNeedsAnimate(); 729 host_->SetNeedsAnimate();
730 } 730 }
731 731
732 } // namespace content 732 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698