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

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 1144333004: Make WebView work for external displays (over Presentations). Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fixes according to boliu/jdduke's comments Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 9440da58aa1993f57caa7e4bece56aef9edc957f..d4afcdb450b108669e1261a086d0c41f845c7bab 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -218,7 +218,8 @@ scoped_ptr<cc::SurfaceIdAllocator> CompositorImpl::CreateSurfaceIdAllocator() {
CompositorImpl::CompositorImpl(CompositorClient* client,
gfx::NativeWindow root_window)
: root_layer_(cc::Layer::Create(Compositor::LayerSettings())),
- resource_manager_(&ui_resource_provider_),
+ resource_manager_(&ui_resource_provider_,
+ root_window->GetJavaDisplayContext().obj()),
surface_id_allocator_(GetSurfaceManager() ? CreateSurfaceIdAllocator()
: nullptr),
has_transparent_background_(false),
@@ -543,10 +544,12 @@ static scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
CreateGpuProcessViewContext(
const scoped_refptr<GpuChannelHost>& gpu_channel_host,
const blink::WebGraphicsContext3D::Attributes attributes,
- int surface_id) {
+ int surface_id,
+ gfx::NativeWindow nativeWindow) {
GURL url("chrome://gpu/Compositor::createContext3D");
static const size_t kBytesPerPixel = 4;
- gfx::DeviceDisplayInfo display_info;
+ const gfx::DeviceDisplayInfo& display_info =
+ nativeWindow->GetDeviceDisplayInfo();
size_t full_screen_texture_size_in_bytes =
display_info.GetDisplayHeight() *
display_info.GetDisplayWidth() *
@@ -644,7 +647,8 @@ void CompositorImpl::CreateOutputSurface() {
scoped_refptr<GpuChannelHost> gpu_channel_host(factory->GetGpuChannel());
scoped_refptr<ContextProviderCommandBuffer> context_provider(
ContextProviderCommandBuffer::Create(
- CreateGpuProcessViewContext(gpu_channel_host, attrs, surface_id_),
+ CreateGpuProcessViewContext(gpu_channel_host, attrs, surface_id_,
+ root_window_),
BROWSER_COMPOSITOR_ONSCREEN_CONTEXT));
DCHECK(context_provider.get());

Powered by Google App Engine
This is Rietveld 408576698