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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 23660006: FeatureInfo: Remove allowed_extensions and init workarounds early (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android_webview build 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
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 "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 534
535 // Overridden from AsyncAPIInterface. 535 // Overridden from AsyncAPIInterface.
536 virtual const char* GetCommandName(unsigned int command_id) const OVERRIDE; 536 virtual const char* GetCommandName(unsigned int command_id) const OVERRIDE;
537 537
538 // Overridden from GLES2Decoder. 538 // Overridden from GLES2Decoder.
539 virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface, 539 virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface,
540 const scoped_refptr<gfx::GLContext>& context, 540 const scoped_refptr<gfx::GLContext>& context,
541 bool offscreen, 541 bool offscreen,
542 const gfx::Size& size, 542 const gfx::Size& size,
543 const DisallowedFeatures& disallowed_features, 543 const DisallowedFeatures& disallowed_features,
544 const char* allowed_extensions,
545 const std::vector<int32>& attribs) OVERRIDE; 544 const std::vector<int32>& attribs) OVERRIDE;
546 virtual void Destroy(bool have_context) OVERRIDE; 545 virtual void Destroy(bool have_context) OVERRIDE;
547 virtual void SetSurface( 546 virtual void SetSurface(
548 const scoped_refptr<gfx::GLSurface>& surface) OVERRIDE; 547 const scoped_refptr<gfx::GLSurface>& surface) OVERRIDE;
549 virtual bool ProduceFrontBuffer(const Mailbox& mailbox) OVERRIDE; 548 virtual bool ProduceFrontBuffer(const Mailbox& mailbox) OVERRIDE;
550 virtual bool ResizeOffscreenFrameBuffer(const gfx::Size& size) OVERRIDE; 549 virtual bool ResizeOffscreenFrameBuffer(const gfx::Size& size) OVERRIDE;
551 void UpdateParentTextureInfo(); 550 void UpdateParentTextureInfo();
552 virtual bool MakeCurrent() OVERRIDE; 551 virtual bool MakeCurrent() OVERRIDE;
553 virtual void ReleaseCurrent() OVERRIDE; 552 virtual void ReleaseCurrent() OVERRIDE;
554 virtual GLES2Util* GetGLES2Util() OVERRIDE { return &util_; } 553 virtual GLES2Util* GetGLES2Util() OVERRIDE { return &util_; }
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 2113
2115 GLES2DecoderImpl::~GLES2DecoderImpl() { 2114 GLES2DecoderImpl::~GLES2DecoderImpl() {
2116 } 2115 }
2117 2116
2118 bool GLES2DecoderImpl::Initialize( 2117 bool GLES2DecoderImpl::Initialize(
2119 const scoped_refptr<gfx::GLSurface>& surface, 2118 const scoped_refptr<gfx::GLSurface>& surface,
2120 const scoped_refptr<gfx::GLContext>& context, 2119 const scoped_refptr<gfx::GLContext>& context,
2121 bool offscreen, 2120 bool offscreen,
2122 const gfx::Size& size, 2121 const gfx::Size& size,
2123 const DisallowedFeatures& disallowed_features, 2122 const DisallowedFeatures& disallowed_features,
2124 const char* allowed_extensions,
2125 const std::vector<int32>& attribs) { 2123 const std::vector<int32>& attribs) {
2126 TRACE_EVENT0("gpu", "GLES2DecoderImpl::Initialize"); 2124 TRACE_EVENT0("gpu", "GLES2DecoderImpl::Initialize");
2127 DCHECK(context->IsCurrent(surface.get())); 2125 DCHECK(context->IsCurrent(surface.get()));
2128 DCHECK(!context_.get()); 2126 DCHECK(!context_.get());
2129 2127
2130 set_initialized(); 2128 set_initialized();
2131 gpu_tracer_ = GPUTracer::Create(); 2129 gpu_tracer_ = GPUTracer::Create();
2132 2130
2133 if (CommandLine::ForCurrentProcess()->HasSwitch( 2131 if (CommandLine::ForCurrentProcess()->HasSwitch(
2134 switches::kEnableGPUDebugging)) { 2132 switches::kEnableGPUDebugging)) {
2135 set_debug(true); 2133 set_debug(true);
2136 } 2134 }
2137 2135
2138 if (CommandLine::ForCurrentProcess()->HasSwitch( 2136 if (CommandLine::ForCurrentProcess()->HasSwitch(
2139 switches::kEnableGPUCommandLogging)) { 2137 switches::kEnableGPUCommandLogging)) {
2140 set_log_commands(true); 2138 set_log_commands(true);
2141 } 2139 }
2142 2140
2143 compile_shader_always_succeeds_ = CommandLine::ForCurrentProcess()->HasSwitch( 2141 compile_shader_always_succeeds_ = CommandLine::ForCurrentProcess()->HasSwitch(
2144 switches::kCompileShaderAlwaysSucceeds); 2142 switches::kCompileShaderAlwaysSucceeds);
2145 2143
2146 2144
2147 // Take ownership of the context and surface. The surface can be replaced with 2145 // Take ownership of the context and surface. The surface can be replaced with
2148 // SetSurface. 2146 // SetSurface.
2149 context_ = context; 2147 context_ = context;
2150 surface_ = surface; 2148 surface_ = surface;
2151 2149
2152 if (!group_->Initialize(this, disallowed_features, allowed_extensions)) { 2150 if (!group_->Initialize(this, disallowed_features)) {
2153 LOG(ERROR) << "GpuScheduler::InitializeCommon failed because group " 2151 LOG(ERROR) << "GpuScheduler::InitializeCommon failed because group "
2154 << "failed to initialize."; 2152 << "failed to initialize.";
2155 group_ = NULL; // Must not destroy ContextGroup if it is not initialized. 2153 group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
2156 Destroy(true); 2154 Destroy(true);
2157 return false; 2155 return false;
2158 } 2156 }
2159 CHECK_GL_ERROR(); 2157 CHECK_GL_ERROR();
2160 2158
2161 disallowed_features_ = disallowed_features; 2159 disallowed_features_ = disallowed_features;
2162 2160
(...skipping 6548 matching lines...) Expand 10 before | Expand all | Expand 10 after
8711 8709
8712 *result = 1; // true. 8710 *result = 1; // true.
8713 return error::kNoError; 8711 return error::kNoError;
8714 } 8712 }
8715 8713
8716 error::Error GLES2DecoderImpl::HandleGetRequestableExtensionsCHROMIUM( 8714 error::Error GLES2DecoderImpl::HandleGetRequestableExtensionsCHROMIUM(
8717 uint32 immediate_data_size, 8715 uint32 immediate_data_size,
8718 const cmds::GetRequestableExtensionsCHROMIUM& c) { 8716 const cmds::GetRequestableExtensionsCHROMIUM& c) {
8719 Bucket* bucket = CreateBucket(c.bucket_id); 8717 Bucket* bucket = CreateBucket(c.bucket_id);
8720 scoped_refptr<FeatureInfo> info(new FeatureInfo()); 8718 scoped_refptr<FeatureInfo> info(new FeatureInfo());
8721 info->Initialize(disallowed_features_, NULL); 8719 info->Initialize(disallowed_features_);
8722 bucket->SetFromString(info->extensions().c_str()); 8720 bucket->SetFromString(info->extensions().c_str());
8723 return error::kNoError; 8721 return error::kNoError;
8724 } 8722 }
8725 8723
8726 error::Error GLES2DecoderImpl::HandleRequestExtensionCHROMIUM( 8724 error::Error GLES2DecoderImpl::HandleRequestExtensionCHROMIUM(
8727 uint32 immediate_data_size, const cmds::RequestExtensionCHROMIUM& c) { 8725 uint32 immediate_data_size, const cmds::RequestExtensionCHROMIUM& c) {
8728 Bucket* bucket = GetBucket(c.bucket_id); 8726 Bucket* bucket = GetBucket(c.bucket_id);
8729 if (!bucket || bucket->size() == 0) { 8727 if (!bucket || bucket->size() == 0) {
8730 return error::kInvalidArguments; 8728 return error::kInvalidArguments;
8731 } 8729 }
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
10264 return error::kNoError; 10262 return error::kNoError;
10265 } 10263 }
10266 10264
10267 // Include the auto-generated part of this file. We split this because it means 10265 // Include the auto-generated part of this file. We split this because it means
10268 // we can easily edit the non-auto generated parts right here in this file 10266 // we can easily edit the non-auto generated parts right here in this file
10269 // instead of having to edit some template or the code generator. 10267 // instead of having to edit some template or the code generator.
10270 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 10268 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10271 10269
10272 } // namespace gles2 10270 } // namespace gles2
10273 } // namespace gpu 10271 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698