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

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

Issue 213743003: Pass GL context bind_generates_resources flag to GPU Service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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/image_transport_factory_android.h" 5 #include "content/browser/renderer_host/image_transport_factory_android.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
10 #include "content/common/gpu/client/gl_helper.h" 10 #include "content/common/gpu/client/gl_helper.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 display_info.GetDisplayWidth() * 75 display_info.GetDisplayWidth() *
76 kBytesPerPixel; 76 kBytesPerPixel;
77 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; 77 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits;
78 limits.command_buffer_size = 64 * 1024; 78 limits.command_buffer_size = 64 * 1024;
79 limits.start_transfer_buffer_size = 64 * 1024; 79 limits.start_transfer_buffer_size = 64 * 1024;
80 limits.min_transfer_buffer_size = 64 * 1024; 80 limits.min_transfer_buffer_size = 64 * 1024;
81 limits.max_transfer_buffer_size = std::min( 81 limits.max_transfer_buffer_size = std::min(
82 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); 82 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize);
83 limits.mapped_memory_reclaim_limit = 83 limits.mapped_memory_reclaim_limit =
84 WebGraphicsContext3DCommandBufferImpl::kNoLimit; 84 WebGraphicsContext3DCommandBufferImpl::kNoLimit;
85 bool bind_generates_resource = false;
86 bool lose_context_when_out_of_memory = false; 85 bool lose_context_when_out_of_memory = false;
87 context_.reset( 86 context_.reset(
88 new WebGraphicsContext3DCommandBufferImpl(0, // offscreen 87 new WebGraphicsContext3DCommandBufferImpl(0, // offscreen
89 url, 88 url,
90 gpu_channel_host.get(), 89 gpu_channel_host.get(),
91 attrs, 90 attrs,
92 bind_generates_resource,
93 lose_context_when_out_of_memory, 91 lose_context_when_out_of_memory,
94 limits, 92 limits,
95 NULL)); 93 NULL));
96 context_->setContextLostCallback(context_lost_listener_.get()); 94 context_->setContextLostCallback(context_lost_listener_.get());
97 if (context_->makeContextCurrent()) 95 if (context_->makeContextCurrent())
98 context_->pushGroupMarkerEXT( 96 context_->pushGroupMarkerEXT(
99 base::StringPrintf("CmdBufferImageTransportFactory-%p", 97 base::StringPrintf("CmdBufferImageTransportFactory-%p",
100 context_.get()).c_str()); 98 context_.get()).c_str());
101 } 99 }
102 100
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 189
192 void GLContextLostListener::DidLoseContext() { 190 void GLContextLostListener::DidLoseContext() {
193 delete g_factory; 191 delete g_factory;
194 g_factory = NULL; 192 g_factory = NULL;
195 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver, 193 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver,
196 g_factory_observers.Get(), 194 g_factory_observers.Get(),
197 OnLostResources()); 195 OnLostResources());
198 } 196 }
199 197
200 } // namespace content 198 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698