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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 23618031: [Android WebView] Clean up global GL resource pt.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2997 matching lines...) Expand 10 before | Expand all | Expand 10 after
3008 GpuChannelHost* gpu_channel_host = 3008 GpuChannelHost* gpu_channel_host =
3009 RenderThreadImpl::current()->EstablishGpuChannelSync( 3009 RenderThreadImpl::current()->EstablishGpuChannelSync(
3010 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); 3010 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
3011 if (!gpu_channel_host) { 3011 if (!gpu_channel_host) {
3012 LOG(ERROR) << "Failed to establish GPU channel for media player"; 3012 LOG(ERROR) << "Failed to establish GPU channel for media player";
3013 return NULL; 3013 return NULL;
3014 } 3014 }
3015 3015
3016 scoped_refptr<cc::ContextProvider> context_provider = 3016 scoped_refptr<cc::ContextProvider> context_provider =
3017 RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); 3017 RenderThreadImpl::current()->OffscreenContextProviderForMainThread();
3018 if (!context_provider.get()) { 3018 scoped_ptr<StreamTextureFactory> stream_texture_factory;
3019 LOG(ERROR) << "Failed to get context3d for media player"; 3019 if (UsingSynchronousRendererCompositor()) {
3020 return NULL; 3020 SynchronousCompositorFactory* factory =
3021 SynchronousCompositorFactory::GetInstance();
3022 stream_texture_factory = factory->CreateStreamTextureFactory(routing_id_);
3023 } else {
3024 if (!context_provider.get()) {
3025 LOG(ERROR) << "Failed to get context3d for media player";
3026 return NULL;
3027 }
3028
3029 stream_texture_factory.reset(new StreamTextureFactoryImpl(
3030 context_provider->Context3d(), gpu_channel_host, routing_id_));
3021 } 3031 }
3022 3032
3023 if (!media_player_proxy_) { 3033 if (!media_player_proxy_) {
3024 media_player_proxy_ = new WebMediaPlayerProxyAndroid( 3034 media_player_proxy_ = new WebMediaPlayerProxyAndroid(
3025 this, media_player_manager_.get()); 3035 this, media_player_manager_.get());
3026 } 3036 }
3027 3037
3028 scoped_ptr<StreamTextureFactory> stream_texture_factory;
3029 if (UsingSynchronousRendererCompositor()) {
3030 SynchronousCompositorFactory* factory =
3031 SynchronousCompositorFactory::GetInstance();
3032 stream_texture_factory = factory->CreateStreamTextureFactory(routing_id_);
3033 } else {
3034 stream_texture_factory.reset(new StreamTextureFactoryImpl(
3035 context_provider->Context3d(), gpu_channel_host, routing_id_));
3036 }
3037
3038 scoped_ptr<WebMediaPlayerAndroid> web_media_player_android( 3038 scoped_ptr<WebMediaPlayerAndroid> web_media_player_android(
3039 new WebMediaPlayerAndroid( 3039 new WebMediaPlayerAndroid(
3040 frame, 3040 frame,
3041 client, 3041 client,
3042 AsWeakPtr(), 3042 AsWeakPtr(),
3043 media_player_manager_.get(), 3043 media_player_manager_.get(),
3044 media_player_proxy_, 3044 media_player_proxy_,
3045 stream_texture_factory.release(), 3045 stream_texture_factory.release(),
3046 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), 3046 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(),
3047 new RenderMediaLog())); 3047 new RenderMediaLog()));
(...skipping 3469 matching lines...) Expand 10 before | Expand all | Expand 10 after
6517 for (size_t i = 0; i < icon_urls.size(); i++) { 6517 for (size_t i = 0; i < icon_urls.size(); i++) {
6518 WebURL url = icon_urls[i].iconURL(); 6518 WebURL url = icon_urls[i].iconURL();
6519 if (!url.isEmpty()) 6519 if (!url.isEmpty())
6520 urls.push_back(FaviconURL(url, 6520 urls.push_back(FaviconURL(url,
6521 ToFaviconType(icon_urls[i].iconType()))); 6521 ToFaviconType(icon_urls[i].iconType())));
6522 } 6522 }
6523 SendUpdateFaviconURL(urls); 6523 SendUpdateFaviconURL(urls);
6524 } 6524 }
6525 6525
6526 } // namespace content 6526 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698