Commit f3cd3806 authored by danakj's avatar danakj Committed by Commit bot

Use gpu::SharedMemoryLimits for in process GL contexts.

Replace the GLInProcessContextSharedMemoryLimits class with our new
SharedMemoryLimits class, so we can share implementations and defaults.

R=boliu@chromium.org, piman@chromium.org
BUG=584497
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1898033005

Cr-Commit-Position: refs/heads/master@{#388633}
parent 0ce639dc
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "gpu/command_buffer/client/gl_in_process_context.h" #include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h" #include "gpu/command_buffer/client/gles2_lib.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h" #include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h"
#include "third_party/skia/include/gpu/GrContext.h" #include "third_party/skia/include/gpu/GrContext.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h"
...@@ -50,11 +51,20 @@ AwRenderThreadContextProvider::AwRenderThreadContextProvider( ...@@ -50,11 +51,20 @@ AwRenderThreadContextProvider::AwRenderThreadContextProvider(
attributes.samples = 0; attributes.samples = 0;
attributes.sample_buffers = 0; attributes.sample_buffers = 0;
attributes.bind_generates_resource = false; attributes.bind_generates_resource = false;
gpu::SharedMemoryLimits limits;
// This context is only used for the display compositor, and there are no
// uploads done with it at all. We choose a small transfer buffer limit
// here, the minimums match the display compositor context for the android
// browser. We don't set the max since we expect the transfer buffer to be
// relatively unused.
limits.start_transfer_buffer_size = 64 * 1024;
limits.min_transfer_buffer_size = 64 * 1024;
context_.reset(gpu::GLInProcessContext::Create( context_.reset(gpu::GLInProcessContext::Create(
service, surface, surface->IsOffscreen(), gfx::kNullAcceleratedWidget, service, surface, surface->IsOffscreen(), gfx::kNullAcceleratedWidget,
surface->GetSize(), nullptr /* share_context */, attributes, surface->GetSize(), nullptr /* share_context */, attributes,
gfx::PreferDiscreteGpu, gpu::GLInProcessContextSharedMemoryLimits(), gfx::PreferDiscreteGpu, limits, nullptr, nullptr));
nullptr, nullptr));
context_->GetImplementation()->SetLostContextCallback(base::Bind( context_->GetImplementation()->SetLostContextCallback(base::Bind(
&AwRenderThreadContextProvider::OnLostContext, base::Unretained(this))); &AwRenderThreadContextProvider::OnLostContext, base::Unretained(this)));
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "gpu/command_buffer/client/gl_in_process_context.h" #include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h" #include "gpu/command_buffer/client/gles2_lib.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/skia_bindings/grcontext_for_gles2_interface.h" #include "gpu/skia_bindings/grcontext_for_gles2_interface.h"
#include "third_party/skia/include/gpu/GrContext.h" #include "third_party/skia/include/gpu/GrContext.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h"
...@@ -43,7 +44,7 @@ BlimpContextProvider::BlimpContextProvider( ...@@ -43,7 +44,7 @@ BlimpContextProvider::BlimpContextProvider(
context_.reset(gpu::GLInProcessContext::Create( context_.reset(gpu::GLInProcessContext::Create(
nullptr /* service */, nullptr /* surface */, false /* is_offscreen */, nullptr /* service */, nullptr /* surface */, false /* is_offscreen */,
widget, gfx::Size(1, 1), nullptr /* share_context */, attribs_for_gles2, widget, gfx::Size(1, 1), nullptr /* share_context */, attribs_for_gles2,
gfx::PreferDiscreteGpu, gpu::GLInProcessContextSharedMemoryLimits(), gfx::PreferDiscreteGpu, gpu::SharedMemoryLimits(),
gpu_memory_buffer_manager, nullptr /* memory_limits */)); gpu_memory_buffer_manager, nullptr /* memory_limits */));
context_->GetImplementation()->SetLostContextCallback( context_->GetImplementation()->SetLostContextCallback(
base::Bind(&BlimpContextProvider::OnLostContext, base::Unretained(this))); base::Bind(&BlimpContextProvider::OnLostContext, base::Unretained(this)));
......
...@@ -3,6 +3,7 @@ include_rules = [ ...@@ -3,6 +3,7 @@ include_rules = [
"+gpu/command_buffer/client/gles2_implementation.h", "+gpu/command_buffer/client/gles2_implementation.h",
"+gpu/command_buffer/client/gles2_interface_stub.h", "+gpu/command_buffer/client/gles2_interface_stub.h",
"+gpu/command_buffer/client/gles2_lib.h", "+gpu/command_buffer/client/gles2_lib.h",
"+gpu/command_buffer/client/shared_memory_limits.h",
"+gpu/command_buffer/common/gles2_cmd_utils.h", "+gpu/command_buffer/common/gles2_cmd_utils.h",
"+gpu/command_buffer/service/image_factory.h", "+gpu/command_buffer/service/image_factory.h",
"+gpu/skia_bindings/grcontext_for_gles2_interface.h", "+gpu/skia_bindings/grcontext_for_gles2_interface.h",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "gpu/command_buffer/client/gl_in_process_context.h" #include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h" #include "gpu/command_buffer/client/gles2_lib.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/skia_bindings/grcontext_for_gles2_interface.h" #include "gpu/skia_bindings/grcontext_for_gles2_interface.h"
#include "third_party/khronos/GLES2/gl2.h" #include "third_party/khronos/GLES2/gl2.h"
...@@ -47,8 +48,7 @@ std::unique_ptr<gpu::GLInProcessContext> CreateTestInProcessContext( ...@@ -47,8 +48,7 @@ std::unique_ptr<gpu::GLInProcessContext> CreateTestInProcessContext(
base::WrapUnique(gpu::GLInProcessContext::Create( base::WrapUnique(gpu::GLInProcessContext::Create(
nullptr, nullptr, is_offscreen, gfx::kNullAcceleratedWidget, nullptr, nullptr, is_offscreen, gfx::kNullAcceleratedWidget,
gfx::Size(1, 1), shared_context, attribs, gpu_preference, gfx::Size(1, 1), shared_context, attribs, gpu_preference,
gpu::GLInProcessContextSharedMemoryLimits(), gpu::SharedMemoryLimits(), gpu_memory_buffer_manager, image_factory));
gpu_memory_buffer_manager, image_factory));
DCHECK(context); DCHECK(context);
return context; return context;
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "content/browser/compositor/gl_helper_scaling.h" #include "content/browser/compositor/gl_helper_scaling.h"
#include "gpu/command_buffer/client/gl_in_process_context.h" #include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkTypes.h" #include "third_party/skia/include/core/SkTypes.h"
...@@ -67,8 +68,7 @@ class GLHelperTest : public testing::Test { ...@@ -67,8 +68,7 @@ class GLHelperTest : public testing::Test {
gfx::kNullAcceleratedWidget, /* window */ gfx::kNullAcceleratedWidget, /* window */
gfx::Size(1, 1), /* size */ gfx::Size(1, 1), /* size */
nullptr, /* share_context */ nullptr, /* share_context */
attributes, gfx::PreferDiscreteGpu, attributes, gfx::PreferDiscreteGpu, gpu::SharedMemoryLimits(),
::gpu::GLInProcessContextSharedMemoryLimits(),
nullptr, /* gpu_memory_buffer_manager */ nullptr, /* gpu_memory_buffer_manager */
nullptr /* image_factory */)); nullptr /* image_factory */));
gl_ = context_->GetImplementation(); gl_ = context_->GetImplementation();
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "content/browser/compositor/gl_helper_scaling.h" #include "content/browser/compositor/gl_helper_scaling.h"
#include "gpu/command_buffer/client/gl_in_process_context.h" #include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkTypes.h" #include "third_party/skia/include/core/SkTypes.h"
...@@ -72,8 +73,7 @@ class GLHelperTest : public testing::Test { ...@@ -72,8 +73,7 @@ class GLHelperTest : public testing::Test {
gfx::kNullAcceleratedWidget, /* window */ gfx::kNullAcceleratedWidget, /* window */
gfx::Size(1, 1), /* size */ gfx::Size(1, 1), /* size */
nullptr, /* share_context */ nullptr, /* share_context */
attributes, gfx::PreferDiscreteGpu, attributes, gfx::PreferDiscreteGpu, gpu::SharedMemoryLimits(),
::gpu::GLInProcessContextSharedMemoryLimits(),
nullptr, /* gpu_memory_buffer_manager */ nullptr, /* gpu_memory_buffer_manager */
nullptr /* image_factory */)); nullptr /* image_factory */));
gl_ = context_->GetImplementation(); gl_ = context_->GetImplementation();
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "content/browser/compositor/gl_helper.h" #include "content/browser/compositor/gl_helper.h"
#include "gpu/command_buffer/client/gl_in_process_context.h" #include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "media/base/video_frame.h" #include "media/base/video_frame.h"
#include "media/base/video_util.h" #include "media/base/video_util.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -45,8 +46,7 @@ class YUVReadbackTest : public testing::Test { ...@@ -45,8 +46,7 @@ class YUVReadbackTest : public testing::Test {
gfx::kNullAcceleratedWidget, /* window */ gfx::kNullAcceleratedWidget, /* window */
gfx::Size(1, 1), /* size */ gfx::Size(1, 1), /* size */
nullptr, /* share_context */ nullptr, /* share_context */
attributes, gfx::PreferDiscreteGpu, attributes, gfx::PreferDiscreteGpu, gpu::SharedMemoryLimits(),
::gpu::GLInProcessContextSharedMemoryLimits(),
nullptr, /* gpu_memory_buffer_manager */ nullptr, /* gpu_memory_buffer_manager */
nullptr /* image_factory */)); nullptr /* image_factory */));
gl_ = context_->GetImplementation(); gl_ = context_->GetImplementation();
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "gpu/command_buffer/client/gl_in_process_context.h" #include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_surface.h" #include "ui/gl/gl_surface.h"
...@@ -37,8 +38,7 @@ class ContextTestBase : public testing::Test { ...@@ -37,8 +38,7 @@ class ContextTestBase : public testing::Test {
gfx::kNullAcceleratedWidget, /* window */ gfx::kNullAcceleratedWidget, /* window */
gfx::Size(1, 1), /* size */ gfx::Size(1, 1), /* size */
nullptr, /* share_context */ nullptr, /* share_context */
attributes, gfx::PreferDiscreteGpu, attributes, gfx::PreferDiscreteGpu, gpu::SharedMemoryLimits(),
::gpu::GLInProcessContextSharedMemoryLimits(),
nullptr, /* gpu_memory_buffer_manager */ nullptr, /* gpu_memory_buffer_manager */
nullptr /* image_factory */)); nullptr /* image_factory */));
gl_ = context_->GetImplementation(); gl_ = context_->GetImplementation();
......
...@@ -43,17 +43,11 @@ namespace gpu { ...@@ -43,17 +43,11 @@ namespace gpu {
namespace { namespace {
const int32_t kDefaultCommandBufferSize = 1024 * 1024;
const unsigned int kDefaultStartTransferBufferSize = 4 * 1024 * 1024;
const unsigned int kDefaultMinTransferBufferSize = 1 * 256 * 1024;
const unsigned int kDefaultMaxTransferBufferSize = 16 * 1024 * 1024;
class GLInProcessContextImpl class GLInProcessContextImpl
: public GLInProcessContext, : public GLInProcessContext,
public base::SupportsWeakPtr<GLInProcessContextImpl> { public base::SupportsWeakPtr<GLInProcessContextImpl> {
public: public:
explicit GLInProcessContextImpl( GLInProcessContextImpl();
const GLInProcessContextSharedMemoryLimits& mem_limits);
~GLInProcessContextImpl() override; ~GLInProcessContextImpl() override;
bool Initialize(scoped_refptr<gfx::GLSurface> surface, bool Initialize(scoped_refptr<gfx::GLSurface> surface,
...@@ -64,12 +58,12 @@ class GLInProcessContextImpl ...@@ -64,12 +58,12 @@ class GLInProcessContextImpl
const gpu::gles2::ContextCreationAttribHelper& attribs, const gpu::gles2::ContextCreationAttribHelper& attribs,
gfx::GpuPreference gpu_preference, gfx::GpuPreference gpu_preference,
const scoped_refptr<InProcessCommandBuffer::Service>& service, const scoped_refptr<InProcessCommandBuffer::Service>& service,
const SharedMemoryLimits& mem_limits,
GpuMemoryBufferManager* gpu_memory_buffer_manager, GpuMemoryBufferManager* gpu_memory_buffer_manager,
ImageFactory* image_factory); ImageFactory* image_factory);
// GLInProcessContext implementation: // GLInProcessContext implementation:
gles2::GLES2Implementation* GetImplementation() override; gles2::GLES2Implementation* GetImplementation() override;
size_t GetMappedMemoryLimit() override;
void SetLock(base::Lock* lock) override; void SetLock(base::Lock* lock) override;
private: private:
...@@ -81,14 +75,10 @@ class GLInProcessContextImpl ...@@ -81,14 +75,10 @@ class GLInProcessContextImpl
std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_; std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_;
std::unique_ptr<InProcessCommandBuffer> command_buffer_; std::unique_ptr<InProcessCommandBuffer> command_buffer_;
const GLInProcessContextSharedMemoryLimits mem_limits_;
DISALLOW_COPY_AND_ASSIGN(GLInProcessContextImpl); DISALLOW_COPY_AND_ASSIGN(GLInProcessContextImpl);
}; };
GLInProcessContextImpl::GLInProcessContextImpl( GLInProcessContextImpl::GLInProcessContextImpl() = default;
const GLInProcessContextSharedMemoryLimits& mem_limits)
: mem_limits_(mem_limits) {}
GLInProcessContextImpl::~GLInProcessContextImpl() { GLInProcessContextImpl::~GLInProcessContextImpl() {
Destroy(); Destroy();
...@@ -98,10 +88,6 @@ gles2::GLES2Implementation* GLInProcessContextImpl::GetImplementation() { ...@@ -98,10 +88,6 @@ gles2::GLES2Implementation* GLInProcessContextImpl::GetImplementation() {
return gles2_implementation_.get(); return gles2_implementation_.get();
} }
size_t GLInProcessContextImpl::GetMappedMemoryLimit() {
return mem_limits_.mapped_memory_reclaim_limit;
}
void GLInProcessContextImpl::SetLock(base::Lock* lock) { void GLInProcessContextImpl::SetLock(base::Lock* lock) {
NOTREACHED(); NOTREACHED();
} }
...@@ -115,6 +101,7 @@ bool GLInProcessContextImpl::Initialize( ...@@ -115,6 +101,7 @@ bool GLInProcessContextImpl::Initialize(
const gles2::ContextCreationAttribHelper& attribs, const gles2::ContextCreationAttribHelper& attribs,
gfx::GpuPreference gpu_preference, gfx::GpuPreference gpu_preference,
const scoped_refptr<InProcessCommandBuffer::Service>& service, const scoped_refptr<InProcessCommandBuffer::Service>& service,
const SharedMemoryLimits& mem_limits,
GpuMemoryBufferManager* gpu_memory_buffer_manager, GpuMemoryBufferManager* gpu_memory_buffer_manager,
ImageFactory* image_factory) { ImageFactory* image_factory) {
DCHECK(size.width() >= 0 && size.height() >= 0); DCHECK(size.width() >= 0 && size.height() >= 0);
...@@ -150,7 +137,7 @@ bool GLInProcessContextImpl::Initialize( ...@@ -150,7 +137,7 @@ bool GLInProcessContextImpl::Initialize(
// Create the GLES2 helper, which writes the command buffer protocol. // Create the GLES2 helper, which writes the command buffer protocol.
gles2_helper_.reset(new gles2::GLES2CmdHelper(command_buffer_.get())); gles2_helper_.reset(new gles2::GLES2CmdHelper(command_buffer_.get()));
if (!gles2_helper_->Initialize(mem_limits_.command_buffer_size)) { if (!gles2_helper_->Initialize(mem_limits.command_buffer_size)) {
LOG(ERROR) << "Failed to initialize GLES2CmdHelper"; LOG(ERROR) << "Failed to initialize GLES2CmdHelper";
Destroy(); Destroy();
return false; return false;
...@@ -175,10 +162,10 @@ bool GLInProcessContextImpl::Initialize( ...@@ -175,10 +162,10 @@ bool GLInProcessContextImpl::Initialize(
command_buffer_.get())); command_buffer_.get()));
if (!gles2_implementation_->Initialize( if (!gles2_implementation_->Initialize(
mem_limits_.start_transfer_buffer_size, mem_limits.start_transfer_buffer_size,
mem_limits_.min_transfer_buffer_size, mem_limits.min_transfer_buffer_size,
mem_limits_.max_transfer_buffer_size, mem_limits.max_transfer_buffer_size,
mem_limits_.mapped_memory_reclaim_limit)) { mem_limits.mapped_memory_reclaim_limit)) {
return false; return false;
} }
...@@ -204,13 +191,6 @@ void GLInProcessContextImpl::Destroy() { ...@@ -204,13 +191,6 @@ void GLInProcessContextImpl::Destroy() {
} // anonymous namespace } // anonymous namespace
GLInProcessContextSharedMemoryLimits::GLInProcessContextSharedMemoryLimits()
: command_buffer_size(kDefaultCommandBufferSize),
start_transfer_buffer_size(kDefaultStartTransferBufferSize),
min_transfer_buffer_size(kDefaultMinTransferBufferSize),
max_transfer_buffer_size(kDefaultMaxTransferBufferSize),
mapped_memory_reclaim_limit(SharedMemoryLimits::kNoLimit) {}
// static // static
GLInProcessContext* GLInProcessContext::Create( GLInProcessContext* GLInProcessContext::Create(
scoped_refptr<gpu::InProcessCommandBuffer::Service> service, scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
...@@ -221,7 +201,7 @@ GLInProcessContext* GLInProcessContext::Create( ...@@ -221,7 +201,7 @@ GLInProcessContext* GLInProcessContext::Create(
GLInProcessContext* share_context, GLInProcessContext* share_context,
const ::gpu::gles2::ContextCreationAttribHelper& attribs, const ::gpu::gles2::ContextCreationAttribHelper& attribs,
gfx::GpuPreference gpu_preference, gfx::GpuPreference gpu_preference,
const GLInProcessContextSharedMemoryLimits& memory_limits, const SharedMemoryLimits& memory_limits,
GpuMemoryBufferManager* gpu_memory_buffer_manager, GpuMemoryBufferManager* gpu_memory_buffer_manager,
ImageFactory* image_factory) { ImageFactory* image_factory) {
if (surface.get()) { if (surface.get()) {
...@@ -230,18 +210,10 @@ GLInProcessContext* GLInProcessContext::Create( ...@@ -230,18 +210,10 @@ GLInProcessContext* GLInProcessContext::Create(
DCHECK_EQ(gfx::kNullAcceleratedWidget, window); DCHECK_EQ(gfx::kNullAcceleratedWidget, window);
} }
std::unique_ptr<GLInProcessContextImpl> context( std::unique_ptr<GLInProcessContextImpl> context(new GLInProcessContextImpl);
new GLInProcessContextImpl(memory_limits)); if (!context->Initialize(surface, is_offscreen, share_context, window, size,
if (!context->Initialize(surface, attribs, gpu_preference, service, memory_limits,
is_offscreen, gpu_memory_buffer_manager, image_factory))
share_context,
window,
size,
attribs,
gpu_preference,
service,
gpu_memory_buffer_manager,
image_factory))
return NULL; return NULL;
return context.release(); return context.release();
......
...@@ -28,21 +28,12 @@ class SurfaceTexture; ...@@ -28,21 +28,12 @@ class SurfaceTexture;
#endif #endif
namespace gpu { namespace gpu {
struct SharedMemoryLimits;
namespace gles2 { namespace gles2 {
class GLES2Implementation; class GLES2Implementation;
} }
struct GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContextSharedMemoryLimits {
GLInProcessContextSharedMemoryLimits();
int32_t command_buffer_size;
unsigned int start_transfer_buffer_size;
unsigned int min_transfer_buffer_size;
unsigned int max_transfer_buffer_size;
unsigned int mapped_memory_reclaim_limit;
};
class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext { class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext {
public: public:
virtual ~GLInProcessContext() {} virtual ~GLInProcessContext() {}
...@@ -64,7 +55,7 @@ class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext { ...@@ -64,7 +55,7 @@ class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext {
GLInProcessContext* share_context, GLInProcessContext* share_context,
const gpu::gles2::ContextCreationAttribHelper& attribs, const gpu::gles2::ContextCreationAttribHelper& attribs,
gfx::GpuPreference gpu_preference, gfx::GpuPreference gpu_preference,
const GLInProcessContextSharedMemoryLimits& memory_limits, const SharedMemoryLimits& memory_limits,
GpuMemoryBufferManager* gpu_memory_buffer_manager, GpuMemoryBufferManager* gpu_memory_buffer_manager,
ImageFactory* image_factory); ImageFactory* image_factory);
...@@ -72,8 +63,6 @@ class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext { ...@@ -72,8 +63,6 @@ class GL_IN_PROCESS_CONTEXT_EXPORT GLInProcessContext {
// can be used without making it current. // can be used without making it current.
virtual gles2::GLES2Implementation* GetImplementation() = 0; virtual gles2::GLES2Implementation* GetImplementation() = 0;
virtual size_t GetMappedMemoryLimit() = 0;
virtual void SetLock(base::Lock* lock) = 0; virtual void SetLock(base::Lock* lock) = 0;
}; };
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "gpu/command_buffer/client/gl_in_process_context.h" #include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h" #include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h" #include "gpu/command_buffer/client/gles2_lib.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/skia_bindings/grcontext_for_gles2_interface.h" #include "gpu/skia_bindings/grcontext_for_gles2_interface.h"
#include "third_party/skia/include/gpu/GrContext.h" #include "third_party/skia/include/gpu/GrContext.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h"
...@@ -89,8 +90,8 @@ bool InProcessContextProvider::BindToCurrentThread() { ...@@ -89,8 +90,8 @@ bool InProcessContextProvider::BindToCurrentThread() {
!window_, /* is_offscreen */ !window_, /* is_offscreen */
window_, gfx::Size(1, 1), window_, gfx::Size(1, 1),
(shared_context_ ? shared_context_->context_.get() : nullptr), attribs_, (shared_context_ ? shared_context_->context_.get() : nullptr), attribs_,
gpu_preference, gpu::GLInProcessContextSharedMemoryLimits(), gpu_preference, gpu::SharedMemoryLimits(), gpu_memory_buffer_manager_,
gpu_memory_buffer_manager_, image_factory_)); image_factory_));
if (!context_) if (!context_)
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment