diff options
26 files changed, 167 insertions, 77 deletions
diff --git a/chrome/browser/gpu_process_host_ui_shim.cc b/chrome/browser/gpu_process_host_ui_shim.cc index c1f6d0c..b45eca6 100644 --- a/chrome/browser/gpu_process_host_ui_shim.cc +++ b/chrome/browser/gpu_process_host_ui_shim.cc @@ -124,10 +124,13 @@ GpuProcessHostUIShim* GpuProcessHostUIShim::GetForRenderer(int renderer_id) { // If Init succeeds, post a task to create the corresponding GpuProcessHost. // The GpuProcessHost will take ownership of the GpuProcessHostUIShim. - BrowserThread::PostTask(BrowserThread::IO, - FROM_HERE, - NewRunnableFunction(&GpuProcessHost::Create, - ui_shim->host_id_)); + BrowserThread::PostTask( + BrowserThread::IO, + FROM_HERE, + NewRunnableFunction( + &GpuProcessHost::Create, + ui_shim->host_id_, + GpuDataManager::GetInstance()->GetGpuFeatureFlags())); return ui_shim; } diff --git a/content/browser/gpu_process_host.cc b/content/browser/gpu_process_host.cc index 6ecec5a..c15ebe8 100644 --- a/content/browser/gpu_process_host.cc +++ b/content/browser/gpu_process_host.cc @@ -102,10 +102,12 @@ class GpuMainThread : public base::Thread { }; // static -GpuProcessHost* GpuProcessHost::Create(int host_id) { +GpuProcessHost* GpuProcessHost::Create( + int host_id, + const GpuFeatureFlags& gpu_feature_flags) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - GpuProcessHost* host = new GpuProcessHost(host_id); + GpuProcessHost* host = new GpuProcessHost(host_id, gpu_feature_flags); if (!host->Init()) { delete host; return NULL; @@ -124,9 +126,12 @@ GpuProcessHost* GpuProcessHost::FromID(int host_id) { return g_hosts_by_id.Lookup(host_id); } -GpuProcessHost::GpuProcessHost(int host_id) +GpuProcessHost::GpuProcessHost( + int host_id, + const GpuFeatureFlags& gpu_feature_flags) : BrowserChildProcessHost(GPU_PROCESS, NULL), - host_id_(host_id) { + host_id_(host_id), + gpu_feature_flags_(gpu_feature_flags) { g_hosts_by_id.AddWithID(this, host_id_); } @@ -296,10 +301,15 @@ bool GpuProcessHost::LaunchGpuProcess() { switches::kLoggingLevel, switches::kNoGpuSandbox, switches::kNoSandbox, + switches::kDisableGLMultisampling, }; cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, arraysize(kSwitchNames)); + if (gpu_feature_flags_.flags() & GpuFeatureFlags::kGpuFeatureMultisampling) { + cmd_line->AppendSwitch(switches::kDisableGLMultisampling); + } + // If specified, prepend a launcher program to the command line. if (!gpu_launcher.empty()) cmd_line->PrependWrapper(gpu_launcher); diff --git a/content/browser/gpu_process_host.h b/content/browser/gpu_process_host.h index 69f5916..35c9163 100644 --- a/content/browser/gpu_process_host.h +++ b/content/browser/gpu_process_host.h @@ -7,6 +7,7 @@ #pragma once #include "base/threading/non_thread_safe.h" +#include "chrome/common/gpu_feature_flags.h" #include "content/browser/browser_child_process_host.h" namespace IPC { @@ -19,7 +20,9 @@ class GpuProcessHost : public BrowserChildProcessHost, // Create a GpuProcessHost with the given ID. The object can be found using // FromID with the same id. - static GpuProcessHost* Create(int host_id); + static GpuProcessHost* Create( + int host_id, + const GpuFeatureFlags& gpu_feature_flags); // Get the GPU process host for the GPU process with the given ID. Returns // null if the process no longer exists. @@ -31,7 +34,9 @@ class GpuProcessHost : public BrowserChildProcessHost, virtual bool OnMessageReceived(const IPC::Message& message); private: - explicit GpuProcessHost(int host_id); + explicit GpuProcessHost( + int host_id, + const GpuFeatureFlags& gpu_feature_flags); virtual ~GpuProcessHost(); bool Init(); @@ -49,6 +54,8 @@ class GpuProcessHost : public BrowserChildProcessHost, // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. int host_id_; + GpuFeatureFlags gpu_feature_flags_; + DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); }; diff --git a/content/common/content_switches.h b/content/common/content_switches.h index 09d576b..c306484 100644 --- a/content/common/content_switches.h +++ b/content/common/content_switches.h @@ -20,6 +20,7 @@ extern const char kDisableDatabases[]; extern const char kDisableDesktopNotifications[]; extern const char kDisableExperimentalWebGL[]; extern const char kDisableFileSystem[]; +extern const char kDisableGLMultisampling[]; extern const char kDisableGpuSandbox[]; extern const char kDisableGpuWatchdog[]; extern const char kDisableHolePunching[]; diff --git a/content/gpu/gpu_channel.cc b/content/gpu/gpu_channel.cc index 7f9435c..017fab1 100644 --- a/content/gpu/gpu_channel.cc +++ b/content/gpu/gpu_channel.cc @@ -31,6 +31,8 @@ GpuChannel::GpuChannel(GpuThread* gpu_thread, DCHECK(renderer_id); const CommandLine* command_line = CommandLine::ForCurrentProcess(); log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); + disallowed_extensions_.multisampling = + command_line->HasSwitch(switches::kDisableGLMultisampling); } GpuChannel::~GpuChannel() { @@ -94,7 +96,8 @@ void GpuChannel::CreateViewCommandBuffer( #if defined(ENABLE_GPU) *route_id = GenerateRouteID(); scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( - this, window, NULL, gfx::Size(), init_params.allowed_extensions, + this, window, NULL, gfx::Size(), disallowed_extensions_, + init_params.allowed_extensions, init_params.attribs, 0, *route_id, renderer_id_, render_view_id)); router_.AddRoute(*route_id, stub.get()); stubs_.AddWithID(stub.release(), *route_id); @@ -173,6 +176,7 @@ void GpuChannel::OnCreateOffscreenCommandBuffer( gfx::kNullPluginWindow, parent_stub, size, + disallowed_extensions_, init_params.allowed_extensions, init_params.attribs, parent_texture_id, diff --git a/content/gpu/gpu_channel.h b/content/gpu/gpu_channel.h index 5ad31e3..9c87c8e 100644 --- a/content/gpu/gpu_channel.h +++ b/content/gpu/gpu_channel.h @@ -120,6 +120,7 @@ class GpuChannel : public IPC::Channel::Listener, #endif // defined (ENABLE_GPU) bool log_messages_; // True if we should log sent and received messages. + gpu::gles2::DisallowedExtensions disallowed_extensions_; DISALLOW_COPY_AND_ASSIGN(GpuChannel); }; diff --git a/content/gpu/gpu_command_buffer_stub.cc b/content/gpu/gpu_command_buffer_stub.cc index a67dfd5..c1e9b1e9 100644 --- a/content/gpu/gpu_command_buffer_stub.cc +++ b/content/gpu/gpu_command_buffer_stub.cc @@ -24,6 +24,7 @@ GpuCommandBufferStub::GpuCommandBufferStub( gfx::PluginWindowHandle handle, GpuCommandBufferStub* parent, const gfx::Size& size, + const gpu::gles2::DisallowedExtensions& disallowed_extensions, const std::string& allowed_extensions, const std::vector<int32>& attribs, uint32 parent_texture_id, @@ -35,6 +36,7 @@ GpuCommandBufferStub::GpuCommandBufferStub( parent_( parent ? parent->AsWeakPtr() : base::WeakPtr<GpuCommandBufferStub>()), initial_size_(size), + disallowed_extensions_(disallowed_extensions), allowed_extensions_(allowed_extensions), requested_attribs_(attribs), parent_texture_id_(parent_texture_id), @@ -236,6 +238,7 @@ void GpuCommandBufferStub::OnInitialize( if (processor_->Initialize( output_window_handle, initial_size_, + disallowed_extensions_, allowed_extensions_.c_str(), requested_attribs_, parent_processor, diff --git a/content/gpu/gpu_command_buffer_stub.h b/content/gpu/gpu_command_buffer_stub.h index 69fbcc0..981ee0a 100644 --- a/content/gpu/gpu_command_buffer_stub.h +++ b/content/gpu/gpu_command_buffer_stub.h @@ -27,16 +27,18 @@ class GpuCommandBufferStub public IPC::Message::Sender, public base::SupportsWeakPtr<GpuCommandBufferStub> { public: - GpuCommandBufferStub(GpuChannel* channel, - gfx::PluginWindowHandle handle, - GpuCommandBufferStub* parent, - const gfx::Size& size, - const std::string& allowed_extensions, - const std::vector<int32>& attribs, - uint32 parent_texture_id, - int32 route_id, - int32 renderer_id, - int32 render_view_id); + GpuCommandBufferStub( + GpuChannel* channel, + gfx::PluginWindowHandle handle, + GpuCommandBufferStub* parent, + const gfx::Size& size, + const gpu::gles2::DisallowedExtensions& disallowed_extensions, + const std::string& allowed_extensions, + const std::vector<int32>& attribs, + uint32 parent_texture_id, + int32 route_id, + int32 renderer_id, + int32 render_view_id); virtual ~GpuCommandBufferStub(); @@ -106,6 +108,7 @@ class GpuCommandBufferStub gfx::PluginWindowHandle handle_; base::WeakPtr<GpuCommandBufferStub> parent_; gfx::Size initial_size_; + gpu::gles2::DisallowedExtensions disallowed_extensions_; std::string allowed_extensions_; std::vector<int32> requested_attribs_; uint32 parent_texture_id_; diff --git a/gpu/command_buffer/client/gles2_demo.cc b/gpu/command_buffer/client/gles2_demo.cc index 05c0003..962cd332 100644 --- a/gpu/command_buffer/client/gles2_demo.cc +++ b/gpu/command_buffer/client/gles2_demo.cc @@ -59,6 +59,7 @@ bool GLES2Demo::Setup(void* hwnd, int32 size) { GPUProcessor* gpu_processor = new GPUProcessor(command_buffer.get(), NULL); if (!gpu_processor->Initialize(reinterpret_cast<HWND>(hwnd), gfx::Size(), + gpu::gles2::DisallowedExtensions(), NULL, std::vector<int32>(), NULL, diff --git a/gpu/command_buffer/service/context_group.cc b/gpu/command_buffer/service/context_group.cc index b542d51..764cc64 100644 --- a/gpu/command_buffer/service/context_group.cc +++ b/gpu/command_buffer/service/context_group.cc @@ -7,6 +7,7 @@ #include "gpu/command_buffer/common/id_allocator.h" #include "gpu/command_buffer/service/buffer_manager.h" #include "gpu/command_buffer/service/framebuffer_manager.h" +#include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/program_manager.h" #include "gpu/command_buffer/service/renderbuffer_manager.h" #include "gpu/command_buffer/service/shader_manager.h" @@ -38,12 +39,13 @@ static void GetIntegerv(GLenum pname, uint32* var) { *var = value; } -bool ContextGroup::Initialize(const char* allowed_features) { +bool ContextGroup::Initialize(const DisallowedExtensions& disallowed_extensions, + const char* allowed_features) { if (initialized_) { return true; } - if (!feature_info_.Initialize(allowed_features)) { + if (!feature_info_.Initialize(disallowed_extensions, allowed_features)) { LOG(ERROR) << "ContextGroup::Initialize failed because FeatureInfo " << "initialization failed."; return false; diff --git a/gpu/command_buffer/service/context_group.h b/gpu/command_buffer/service/context_group.h index f3ae4b7..80b2e46 100644 --- a/gpu/command_buffer/service/context_group.h +++ b/gpu/command_buffer/service/context_group.h @@ -27,6 +27,7 @@ class RenderbufferManager; class ProgramManager; class ShaderManager; class TextureManager; +struct DisallowedExtensions; // A Context Group helps manage multiple GLES2Decoders that share // resources. @@ -38,7 +39,8 @@ class ContextGroup : public base::RefCounted<ContextGroup> { ~ContextGroup(); // This should only be called by GLES2Decoder. - bool Initialize(const char* allowed_features); + bool Initialize(const DisallowedExtensions& disallowed_extensions, + const char* allowed_features); // Sets the ContextGroup has having a lost context. void set_have_context(bool have_context) { diff --git a/gpu/command_buffer/service/context_group_unittest.cc b/gpu/command_buffer/service/context_group_unittest.cc index 78accf9..19d8522 100644 --- a/gpu/command_buffer/service/context_group_unittest.cc +++ b/gpu/command_buffer/service/context_group_unittest.cc @@ -71,8 +71,9 @@ TEST_F(ContextGroupTest, Basic) { } TEST_F(ContextGroupTest, InitializeNoExtensions) { - TestHelper::SetupContextGroupInitExpectations(gl_.get(), ""); - group_->Initialize(""); + TestHelper::SetupContextGroupInitExpectations(gl_.get(), + DisallowedExtensions(), ""); + group_->Initialize(DisallowedExtensions(), ""); EXPECT_EQ(static_cast<uint32>(TestHelper::kNumVertexAttribs), group_->max_vertex_attribs()); EXPECT_EQ(static_cast<uint32>(TestHelper::kNumTextureUnits), diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index ad85737..7a38bf3 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -79,6 +79,14 @@ class ExtensionHelper { }; bool FeatureInfo::Initialize(const char* allowed_features) { + disallowed_extensions_ = DisallowedExtensions(); + AddFeatures(allowed_features); + return true; +} + +bool FeatureInfo::Initialize(const DisallowedExtensions& disallowed_extensions, + const char* allowed_features) { + disallowed_extensions_ = disallowed_extensions; AddFeatures(allowed_features); return true; } @@ -275,7 +283,8 @@ void FeatureInfo::AddFeatures(const char* desired_features) { } // Check for multisample support - if (ext.Desire("GL_CHROMIUM_framebuffer_multisample") && + if (!disallowed_extensions_.multisampling && + ext.Desire("GL_CHROMIUM_framebuffer_multisample") && (ext.Have("GL_EXT_framebuffer_multisample") || ext.Have("GL_ANGLE_framebuffer_multisample"))) { feature_flags_.chromium_framebuffer_multisample = true; diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h index a11aa70..4eb80cc 100644 --- a/gpu/command_buffer/service/feature_info.h +++ b/gpu/command_buffer/service/feature_info.h @@ -6,6 +6,7 @@ #define GPU_COMMAND_BUFFER_SERVICE_FEATURE_INFO_H_ #include <string> +#include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/gles2_cmd_validation.h" namespace gpu { @@ -37,6 +38,8 @@ class FeatureInfo { // If allowed features = NULL or "*", all features are allowed. Otherwise // only features that match the strings in allowed_features are allowed. bool Initialize(const char* allowed_features); + bool Initialize(const DisallowedExtensions& disallowed_extensions, + const char* allowed_features); // Turns on certain features if they can be turned on. NULL turns on // all available features. @@ -59,6 +62,8 @@ class FeatureInfo { Validators validators_; + DisallowedExtensions disallowed_extensions_; + // The extensions string returned by glGetString(GL_EXTENSIONS); std::string extensions_; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index b42c220..0d9f326 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -670,6 +670,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, // Overridden from GLES2Decoder. virtual bool Initialize(gfx::GLContext* context, const gfx::Size& size, + const DisallowedExtensions& disallowed_extensions, const char* allowed_extensions, const std::vector<int32>& attribs, GLES2Decoder* parent, @@ -1442,6 +1443,8 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, scoped_ptr<ShaderTranslator> vertex_translator_; scoped_ptr<ShaderTranslator> fragment_translator_; + DisallowedExtensions disallowed_extensions_; + // Cached from ContextGroup const Validators* validators_; FeatureInfo* feature_info_; @@ -1787,12 +1790,14 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group) } } -bool GLES2DecoderImpl::Initialize(gfx::GLContext* context, - const gfx::Size& size, - const char* allowed_extensions, - const std::vector<int32>& attribs, - GLES2Decoder* parent, - uint32 parent_client_texture_id) { +bool GLES2DecoderImpl::Initialize( + gfx::GLContext* context, + const gfx::Size& size, + const DisallowedExtensions& disallowed_extensions, + const char* allowed_extensions, + const std::vector<int32>& attribs, + GLES2Decoder* parent, + uint32 parent_client_texture_id) { DCHECK(context); DCHECK(!context_.get()); @@ -1811,7 +1816,7 @@ bool GLES2DecoderImpl::Initialize(gfx::GLContext* context, return false; } - if (!group_->Initialize(allowed_extensions)) { + if (!group_->Initialize(disallowed_extensions, allowed_extensions)) { LOG(ERROR) << "GPUProcessor::InitializeCommon failed because group " << "failed to initialize."; Destroy(); @@ -1819,6 +1824,7 @@ bool GLES2DecoderImpl::Initialize(gfx::GLContext* context, } CHECK_GL_ERROR(); + disallowed_extensions_ = disallowed_extensions; vertex_attrib_manager_.Initialize(group_->max_vertex_attribs()); @@ -6168,7 +6174,7 @@ error::Error GLES2DecoderImpl::HandleGetRequestableExtensionsCHROMIUM( const gles2::GetRequestableExtensionsCHROMIUM& c) { Bucket* bucket = CreateBucket(c.bucket_id); scoped_ptr<FeatureInfo> info(new FeatureInfo()); - info->Initialize(NULL); + info->Initialize(disallowed_extensions_, NULL); bucket->SetFromString(info->extensions().c_str()); return error::kNoError; } diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h index 88d1892..92d5300 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder.h @@ -25,6 +25,10 @@ namespace gles2 { class ContextGroup; class GLES2Util; +struct DisallowedExtensions { + bool multisampling; +}; + // This class implements the AsyncAPIInterface interface, decoding GLES2 // commands and calling GL. class GLES2Decoder : public CommonDecoder { @@ -61,6 +65,7 @@ class GLES2Decoder : public CommonDecoder { // true if successful. virtual bool Initialize(gfx::GLContext* context, const gfx::Size& size, + const DisallowedExtensions& disallowed_extensions, const char* allowed_extensions, const std::vector<int32>& attribs, GLES2Decoder* parent, diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h index 0282709..37a7e72 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h @@ -25,12 +25,14 @@ class MockGLES2Decoder : public GLES2Decoder { MockGLES2Decoder(); virtual ~MockGLES2Decoder(); - MOCK_METHOD6(Initialize, bool(gfx::GLContext* context, - const gfx::Size& size, - const char* allowed_extensions, - const std::vector<int32>& attribs, - GLES2Decoder* parent, - uint32 parent_texture_id)); + MOCK_METHOD7(Initialize, + bool(gfx::GLContext* context, + const gfx::Size& size, + const DisallowedExtensions& disallowed_extensions, + const char* allowed_extensions, + const std::vector<int32>& attribs, + GLES2Decoder* parent, + uint32 parent_texture_id)); MOCK_METHOD0(Destroy, void()); MOCK_METHOD1(ResizeOffscreenFrameBuffer, void(const gfx::Size& size)); MOCK_METHOD0(UpdateOffscreenFrameBufferSize, bool()); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc index 18a920f..0699e3b 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -57,9 +57,10 @@ void GLES2DecoderTestBase::InitDecoder( InSequence sequence; - TestHelper::SetupContextGroupInitExpectations(gl_.get(), extensions); + TestHelper::SetupContextGroupInitExpectations(gl_.get(), + DisallowedExtensions(), extensions); - EXPECT_TRUE(group_->Initialize(extensions)); + EXPECT_TRUE(group_->Initialize(DisallowedExtensions(), extensions)); EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _)) .WillOnce(SetArgumentPointee<1>(has_alpha_backbuffer ? 8 : 0)) @@ -129,7 +130,8 @@ void GLES2DecoderTestBase::InitDecoder( decoder_.reset(GLES2Decoder::Create(group_.get())); decoder_->Initialize( - context_, context_->GetSize(), NULL, std::vector<int32>(), NULL, 0); + context_, context_->GetSize(), DisallowedExtensions(), + NULL, std::vector<int32>(), NULL, 0); decoder_->set_engine(engine_.get()); EXPECT_CALL(*gl_, GenBuffersARB(_, _)) diff --git a/gpu/command_buffer/service/gpu_processor.cc b/gpu/command_buffer/service/gpu_processor.cc index b36db6a..45d21d7 100644 --- a/gpu/command_buffer/service/gpu_processor.cc +++ b/gpu/command_buffer/service/gpu_processor.cc @@ -52,12 +52,14 @@ GPUProcessor::~GPUProcessor() { Destroy(); } -bool GPUProcessor::InitializeCommon(gfx::GLContext* context, - const gfx::Size& size, - const char* allowed_extensions, - const std::vector<int32>& attribs, - gles2::GLES2Decoder* parent_decoder, - uint32 parent_texture_id) { +bool GPUProcessor::InitializeCommon( + gfx::GLContext* context, + const gfx::Size& size, + const gles2::DisallowedExtensions& disallowed_extensions, + const char* allowed_extensions, + const std::vector<int32>& attribs, + gles2::GLES2Decoder* parent_decoder, + uint32 parent_texture_id) { DCHECK(context); if (!context->MakeCurrent()) @@ -90,6 +92,7 @@ bool GPUProcessor::InitializeCommon(gfx::GLContext* context, // Initialize the decoder with either the view or pbuffer GLContext. if (!decoder_->Initialize(context, size, + disallowed_extensions, allowed_extensions, attribs, parent_decoder, diff --git a/gpu/command_buffer/service/gpu_processor.h b/gpu/command_buffer/service/gpu_processor.h index b76b6e3..6816d16 100644 --- a/gpu/command_buffer/service/gpu_processor.h +++ b/gpu/command_buffer/service/gpu_processor.h @@ -52,6 +52,7 @@ class GPUProcessor : public CommandBufferEngine { // Perform platform specific and common initialization. bool Initialize(gfx::PluginWindowHandle hwnd, const gfx::Size& size, + const gles2::DisallowedExtensions& disallowed_extensions, const char* allowed_extensions, const std::vector<int32>& attribs, GPUProcessor* parent, @@ -116,12 +117,14 @@ class GPUProcessor : public CommandBufferEngine { protected: // Perform common initialization. Takes ownership of GLContext. - bool InitializeCommon(gfx::GLContext* context, - const gfx::Size& size, - const char* allowed_extensions, - const std::vector<int32>& attribs, - gles2::GLES2Decoder* parent_decoder, - uint32 parent_texture_id); + bool InitializeCommon( + gfx::GLContext* context, + const gfx::Size& size, + const gles2::DisallowedExtensions& disallowed_extensions, + const char* allowed_extensions, + const std::vector<int32>& attribs, + gles2::GLES2Decoder* parent_decoder, + uint32 parent_texture_id); private: diff --git a/gpu/command_buffer/service/gpu_processor_linux.cc b/gpu/command_buffer/service/gpu_processor_linux.cc index cca8663..5627d63 100644 --- a/gpu/command_buffer/service/gpu_processor_linux.cc +++ b/gpu/command_buffer/service/gpu_processor_linux.cc @@ -9,12 +9,14 @@ using ::base::SharedMemory; namespace gpu { -bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, - const gfx::Size& size, - const char* allowed_extensions, - const std::vector<int32>& attribs, - GPUProcessor* parent, - uint32 parent_texture_id) { +bool GPUProcessor::Initialize( + gfx::PluginWindowHandle window, + const gfx::Size& size, + const gles2::DisallowedExtensions& disallowed_extensions, + const char* allowed_extensions, + const std::vector<int32>& attribs, + GPUProcessor* parent, + uint32 parent_texture_id) { // Get the parent decoder and the GLContext to share IDs with, if any. gles2::GLES2Decoder* parent_decoder = NULL; gfx::GLContext* parent_context = NULL; @@ -45,6 +47,7 @@ bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, return InitializeCommon(context.release(), size, + disallowed_extensions, allowed_extensions, attribs, parent_decoder, diff --git a/gpu/command_buffer/service/gpu_processor_mac.cc b/gpu/command_buffer/service/gpu_processor_mac.cc index 4d9ba18..757de57 100644 --- a/gpu/command_buffer/service/gpu_processor_mac.cc +++ b/gpu/command_buffer/service/gpu_processor_mac.cc @@ -9,12 +9,14 @@ using ::base::SharedMemory; namespace gpu { -bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, - const gfx::Size& size, - const char* allowed_extensions, - const std::vector<int32>& attribs, - GPUProcessor* parent, - uint32 parent_texture_id) { +bool GPUProcessor::Initialize( + gfx::PluginWindowHandle window, + const gfx::Size& size, + const gles2::DisallowedExtensions& disallowed_extensions, + const char* allowed_extensions, + const std::vector<int32>& attribs, + GPUProcessor* parent, + uint32 parent_texture_id) { // Get the parent decoder and the GLContext to share IDs with, if any. gles2::GLES2Decoder* parent_decoder = NULL; gfx::GLContext* parent_context = NULL; @@ -53,6 +55,7 @@ bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, return InitializeCommon(context.release(), size, + disallowed_extensions, allowed_extensions, attribs, parent_decoder, diff --git a/gpu/command_buffer/service/gpu_processor_win.cc b/gpu/command_buffer/service/gpu_processor_win.cc index 0ec6b1c..465cf5a 100644 --- a/gpu/command_buffer/service/gpu_processor_win.cc +++ b/gpu/command_buffer/service/gpu_processor_win.cc @@ -11,12 +11,14 @@ using ::base::SharedMemory; namespace gpu { -bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, - const gfx::Size& size, - const char* allowed_extensions, - const std::vector<int32>& attribs, - GPUProcessor* parent, - uint32 parent_texture_id) { +bool GPUProcessor::Initialize( + gfx::PluginWindowHandle window, + const gfx::Size& size, + const gles2::DisallowedExtensions& disallowed_extensions, + const char* allowed_extensions, + const std::vector<int32>& attribs, + GPUProcessor* parent, + uint32 parent_texture_id) { // Get the parent decoder and the GLContext to share IDs with, if any. gles2::GLES2Decoder* parent_decoder = NULL; gfx::GLContext* parent_context = NULL; @@ -44,6 +46,7 @@ bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, return InitializeCommon(context.release(), size, + disallowed_extensions, allowed_extensions, attribs, parent_decoder, diff --git a/gpu/command_buffer/service/test_helper.cc b/gpu/command_buffer/service/test_helper.cc index 9deac87..3de75d5 100644 --- a/gpu/command_buffer/service/test_helper.cc +++ b/gpu/command_buffer/service/test_helper.cc @@ -92,7 +92,9 @@ void TestHelper::SetupTextureManagerInitExpectations( } void TestHelper::SetupContextGroupInitExpectations( - ::gfx::MockGLInterface* gl, const char* extensions) { + ::gfx::MockGLInterface* gl, + const DisallowedExtensions& disallowed_extensions, + const char* extensions) { InSequence sequence; SetupFeatureInfoInitExpectations(gl, extensions); diff --git a/gpu/command_buffer/service/test_helper.h b/gpu/command_buffer/service/test_helper.h index 6c56224..b23a7f1 100644 --- a/gpu/command_buffer/service/test_helper.h +++ b/gpu/command_buffer/service/test_helper.h @@ -11,6 +11,8 @@ namespace gpu { namespace gles2 { +struct DisallowedExtensions; + class TestHelper { public: static const GLuint kServiceBlackTexture2dId = 701; @@ -34,7 +36,9 @@ class TestHelper { static const GLint kMaxVertexUniformComponents = kMaxVertexUniformVectors * 4; static void SetupContextGroupInitExpectations( - ::gfx::MockGLInterface* gl, const char* extensions); + ::gfx::MockGLInterface* gl, + const DisallowedExtensions& disallowed_extensions, + const char* extensions); static void SetupFeatureInfoInitExpectations( ::gfx::MockGLInterface* gl, const char* extensions); static void SetupTextureManagerInitExpectations(::gfx::MockGLInterface* gl); diff --git a/gpu/demos/framework/window.cc b/gpu/demos/framework/window.cc index 825025ef..1440110 100644 --- a/gpu/demos/framework/window.cc +++ b/gpu/demos/framework/window.cc @@ -61,7 +61,9 @@ bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { GPUProcessor* gpu_processor( new GPUProcessor(command_buffer.get(), NULL)); - if (!gpu_processor->Initialize(hwnd, gfx::Size(), NULL, std::vector<int32>(), + if (!gpu_processor->Initialize(hwnd, gfx::Size(), + gpu::gles2::DisallowedExtensions(), + NULL, std::vector<int32>(), NULL, 0)) { return false; } |