Skip to content

Commit

Permalink
Code cleanup: rename DisallowedExtensions to DisallowedFeature.
Browse files Browse the repository at this point in the history
BUG=none
TEST=bots green
Review URL: http://codereview.chromium.org/7979031

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102213 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
zmo@google.com committed Sep 22, 2011
1 parent 959a694 commit e82fb79
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 42 deletions.
8 changes: 4 additions & 4 deletions content/common/gpu/gpu_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
DCHECK(renderer_id);
const CommandLine* command_line = CommandLine::ForCurrentProcess();
log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages);
disallowed_extensions_.multisampling =
disallowed_features_.multisampling =
command_line->HasSwitch(switches::kDisableGLMultisampling);
disallowed_extensions_.driver_bug_workarounds =
disallowed_features_.driver_bug_workarounds =
command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds);
}

Expand Down Expand Up @@ -191,7 +191,7 @@ void GpuChannel::CreateViewCommandBuffer(
share_group,
window,
gfx::Size(),
disallowed_extensions_,
disallowed_features_,
init_params.allowed_extensions,
init_params.attribs,
*route_id,
Expand Down Expand Up @@ -312,7 +312,7 @@ void GpuChannel::OnCreateOffscreenCommandBuffer(
share_group,
gfx::kNullPluginWindow,
size,
disallowed_extensions_,
disallowed_features_,
init_params.allowed_extensions,
init_params.attribs,
route_id,
Expand Down
2 changes: 1 addition & 1 deletion content/common/gpu/gpu_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class GpuChannel : public IPC::Channel::Listener,
TransportTextureMap transport_textures_;

bool log_messages_; // True if we should log sent and received messages.
gpu::gles2::DisallowedExtensions disallowed_extensions_;
gpu::gles2::DisallowedFeatures disallowed_features_;
GpuWatchdog* watchdog_;
bool software_;

Expand Down
6 changes: 3 additions & 3 deletions content/common/gpu/gpu_command_buffer_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GpuCommandBufferStub::GpuCommandBufferStub(
GpuCommandBufferStub* share_group,
gfx::PluginWindowHandle handle,
const gfx::Size& size,
const gpu::gles2::DisallowedExtensions& disallowed_extensions,
const gpu::gles2::DisallowedFeatures& disallowed_features,
const std::string& allowed_extensions,
const std::vector<int32>& attribs,
int32 route_id,
Expand All @@ -37,7 +37,7 @@ GpuCommandBufferStub::GpuCommandBufferStub(
: channel_(channel),
handle_(handle),
initial_size_(size),
disallowed_extensions_(disallowed_extensions),
disallowed_features_(disallowed_features),
allowed_extensions_(allowed_extensions),
requested_attribs_(attribs),
route_id_(route_id),
Expand Down Expand Up @@ -258,7 +258,7 @@ void GpuCommandBufferStub::OnInitialize(
if (!decoder_->Initialize(surface_.get(),
context_.get(),
initial_size_,
disallowed_extensions_,
disallowed_features_,
allowed_extensions_.c_str(),
requested_attribs_)) {
LOG(ERROR) << "Failed to initialize decoder.";
Expand Down
4 changes: 2 additions & 2 deletions content/common/gpu/gpu_command_buffer_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GpuCommandBufferStub
GpuCommandBufferStub* share_group,
gfx::PluginWindowHandle handle,
const gfx::Size& size,
const gpu::gles2::DisallowedExtensions& disallowed_extensions,
const gpu::gles2::DisallowedFeatures& disallowed_features,
const std::string& allowed_extensions,
const std::vector<int32>& attribs,
int32 route_id,
Expand Down Expand Up @@ -155,7 +155,7 @@ class GpuCommandBufferStub

gfx::PluginWindowHandle handle_;
gfx::Size initial_size_;
gpu::gles2::DisallowedExtensions disallowed_extensions_;
gpu::gles2::DisallowedFeatures disallowed_features_;
std::string allowed_extensions_;
std::vector<int32> requested_attribs_;
int32 route_id_;
Expand Down
4 changes: 2 additions & 2 deletions gpu/command_buffer/service/context_group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ static void GetIntegerv(GLenum pname, uint32* var) {
*var = value;
}

bool ContextGroup::Initialize(const DisallowedExtensions& disallowed_extensions,
bool ContextGroup::Initialize(const DisallowedFeatures& disallowed_features,
const char* allowed_features) {
if (initialized_) {
return true;
}

if (!feature_info_.Initialize(disallowed_extensions, allowed_features)) {
if (!feature_info_.Initialize(disallowed_features, allowed_features)) {
LOG(ERROR) << "ContextGroup::Initialize failed because FeatureInfo "
<< "initialization failed.";
return false;
Expand Down
4 changes: 2 additions & 2 deletions gpu/command_buffer/service/context_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class RenderbufferManager;
class ProgramManager;
class ShaderManager;
class TextureManager;
struct DisallowedExtensions;
struct DisallowedFeatures;

// A Context Group helps manage multiple GLES2Decoders that share
// resources.
Expand All @@ -40,7 +40,7 @@ class ContextGroup : public base::RefCounted<ContextGroup> {
~ContextGroup();

// This should only be called by GLES2Decoder.
bool Initialize(const DisallowedExtensions& disallowed_extensions,
bool Initialize(const DisallowedFeatures& disallowed_features,
const char* allowed_features);

// Sets the ContextGroup has having a lost context.
Expand Down
4 changes: 2 additions & 2 deletions gpu/command_buffer/service/context_group_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ TEST_F(ContextGroupTest, Basic) {

TEST_F(ContextGroupTest, InitializeNoExtensions) {
TestHelper::SetupContextGroupInitExpectations(gl_.get(),
DisallowedExtensions(), "");
group_->Initialize(DisallowedExtensions(), "");
DisallowedFeatures(), "");
group_->Initialize(DisallowedFeatures(), "");
EXPECT_EQ(static_cast<uint32>(TestHelper::kNumVertexAttribs),
group_->max_vertex_attribs());
EXPECT_EQ(static_cast<uint32>(TestHelper::kNumTextureUnits),
Expand Down
8 changes: 4 additions & 4 deletions gpu/command_buffer/service/feature_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ class ExtensionHelper {
};

bool FeatureInfo::Initialize(const char* allowed_features) {
disallowed_extensions_ = DisallowedExtensions();
disallowed_features_ = DisallowedFeatures();
AddFeatures(allowed_features);
return true;
}

bool FeatureInfo::Initialize(const DisallowedExtensions& disallowed_extensions,
bool FeatureInfo::Initialize(const DisallowedFeatures& disallowed_features,
const char* allowed_features) {
disallowed_extensions_ = disallowed_extensions;
disallowed_features_ = disallowed_features;
AddFeatures(allowed_features);
return true;
}
Expand Down Expand Up @@ -301,7 +301,7 @@ void FeatureInfo::AddFeatures(const char* desired_features) {
}

// Check for multisample support
if (!disallowed_extensions_.multisampling &&
if (!disallowed_features_.multisampling &&
ext.Desire("GL_CHROMIUM_framebuffer_multisample") &&
(ext.Have("GL_EXT_framebuffer_multisample") ||
ext.Have("GL_ANGLE_framebuffer_multisample"))) {
Expand Down
4 changes: 2 additions & 2 deletions gpu/command_buffer/service/feature_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ 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,
bool Initialize(const DisallowedFeatures& disallowed_features,
const char* allowed_features);

// Turns on certain features if they can be turned on. NULL turns on
Expand All @@ -65,7 +65,7 @@ class FeatureInfo {

Validators validators_;

DisallowedExtensions disallowed_extensions_;
DisallowedFeatures disallowed_features_;

// The extensions string returned by glGetString(GL_EXTENSIONS);
std::string extensions_;
Expand Down
14 changes: 7 additions & 7 deletions gpu/command_buffer/service/gles2_cmd_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface,
const scoped_refptr<gfx::GLContext>& context,
const gfx::Size& size,
const DisallowedExtensions& disallowed_extensions,
const DisallowedFeatures& disallowed_features,
const char* allowed_extensions,
const std::vector<int32>& attribs);
virtual void Destroy();
Expand Down Expand Up @@ -1306,7 +1306,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
scoped_ptr<ShaderTranslator> vertex_translator_;
scoped_ptr<ShaderTranslator> fragment_translator_;

DisallowedExtensions disallowed_extensions_;
DisallowedFeatures disallowed_features_;

// Cached from ContextGroup
const Validators* validators_;
Expand Down Expand Up @@ -1716,7 +1716,7 @@ bool GLES2DecoderImpl::Initialize(
const scoped_refptr<gfx::GLSurface>& surface,
const scoped_refptr<gfx::GLContext>& context,
const gfx::Size& size,
const DisallowedExtensions& disallowed_extensions,
const DisallowedFeatures& disallowed_features,
const char* allowed_extensions,
const std::vector<int32>& attribs) {
DCHECK(context);
Expand All @@ -1739,15 +1739,15 @@ bool GLES2DecoderImpl::Initialize(
return false;
}

if (!group_->Initialize(disallowed_extensions, allowed_extensions)) {
if (!group_->Initialize(disallowed_features, allowed_extensions)) {
LOG(ERROR) << "GpuScheduler::InitializeCommon failed because group "
<< "failed to initialize.";
Destroy();
return false;
}

CHECK_GL_ERROR();
disallowed_extensions_ = disallowed_extensions;
disallowed_features_ = disallowed_features;

vertex_attrib_manager_.Initialize(group_->max_vertex_attribs());

Expand Down Expand Up @@ -1938,7 +1938,7 @@ bool GLES2DecoderImpl::Initialize(

has_arb_robustness_ = context->HasExtension("GL_ARB_robustness");

if (!disallowed_extensions_.driver_bug_workarounds) {
if (!disallowed_features_.driver_bug_workarounds) {
#if defined(OS_MACOSX)
const char* vendor_str = reinterpret_cast<const char*>(
glGetString(GL_VENDOR));
Expand Down Expand Up @@ -6726,7 +6726,7 @@ error::Error GLES2DecoderImpl::HandleGetRequestableExtensionsCHROMIUM(
const gles2::GetRequestableExtensionsCHROMIUM& c) {
Bucket* bucket = CreateBucket(c.bucket_id);
scoped_ptr<FeatureInfo> info(new FeatureInfo());
info->Initialize(disallowed_extensions_, NULL);
info->Initialize(disallowed_features_, NULL);
bucket->SetFromString(info->extensions().c_str());
return error::kNoError;
}
Expand Down
6 changes: 3 additions & 3 deletions gpu/command_buffer/service/gles2_cmd_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ namespace gles2 {
class ContextGroup;
class GLES2Util;

struct DisallowedExtensions {
DisallowedExtensions()
struct DisallowedFeatures {
DisallowedFeatures()
: multisampling(false),
driver_bug_workarounds(false) {
}
Expand Down Expand Up @@ -73,7 +73,7 @@ class GLES2Decoder : public CommonDecoder {
virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface,
const scoped_refptr<gfx::GLContext>& context,
const gfx::Size& size,
const DisallowedExtensions& disallowed_extensions,
const DisallowedFeatures& disallowed_features,
const char* allowed_extensions,
const std::vector<int32>& attribs) = 0;

Expand Down
2 changes: 1 addition & 1 deletion gpu/command_buffer/service/gles2_cmd_decoder_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MockGLES2Decoder : public GLES2Decoder {
bool(const scoped_refptr<gfx::GLSurface>& surface,
const scoped_refptr<gfx::GLContext>& context,
const gfx::Size& size,
const DisallowedExtensions& disallowed_extensions,
const DisallowedFeatures& disallowed_features,
const char* allowed_extensions,
const std::vector<int32>& attribs));
MOCK_METHOD0(Destroy, void());
Expand Down
6 changes: 3 additions & 3 deletions gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ void GLES2DecoderTestBase::InitDecoder(
InSequence sequence;

TestHelper::SetupContextGroupInitExpectations(gl_.get(),
DisallowedExtensions(), extensions);
DisallowedFeatures(), extensions);

EXPECT_TRUE(group_->Initialize(DisallowedExtensions(), NULL));
EXPECT_TRUE(group_->Initialize(DisallowedFeatures(), NULL));

EXPECT_CALL(*gl_, EnableVertexAttribArray(0))
.Times(1)
Expand Down Expand Up @@ -182,7 +182,7 @@ void GLES2DecoderTestBase::InitDecoder(

decoder_.reset(GLES2Decoder::Create(group_.get()));
decoder_->Initialize(
surface_, context_, surface_->GetSize(), DisallowedExtensions(),
surface_, context_, surface_->GetSize(), DisallowedFeatures(),
NULL, attribs);
decoder_->set_engine(engine_.get());

Expand Down
2 changes: 1 addition & 1 deletion gpu/command_buffer/service/test_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void TestHelper::SetupTextureManagerInitExpectations(

void TestHelper::SetupContextGroupInitExpectations(
::gfx::MockGLInterface* gl,
const DisallowedExtensions& disallowed_extensions,
const DisallowedFeatures& disallowed_features,
const char* extensions) {
InSequence sequence;

Expand Down
4 changes: 2 additions & 2 deletions gpu/command_buffer/service/test_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace gpu {
namespace gles2 {

struct DisallowedExtensions;
struct DisallowedFeatures;

class TestHelper {
public:
Expand Down Expand Up @@ -38,7 +38,7 @@ class TestHelper {

static void SetupContextGroupInitExpectations(
::gfx::MockGLInterface* gl,
const DisallowedExtensions& disallowed_extensions,
const DisallowedFeatures& disallowed_features,
const char* extensions);
static void SetupFeatureInfoInitExpectations(
::gfx::MockGLInterface* gl, const char* extensions);
Expand Down
2 changes: 1 addition & 1 deletion gpu/demos/framework/window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) {
if (!decoder_->Initialize(surface_.get(),
context_.get(),
gfx::Size(),
gpu::gles2::DisallowedExtensions(),
gpu::gles2::DisallowedFeatures(),
NULL,
attribs)) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion gpu/gles2_conform_support/egl/display.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ EGLSurface Display::CreateWindowSurface(EGLConfig config,
if (!decoder_->Initialize(gl_surface_.get(),
gl_context_.get(),
gfx::Size(),
gpu::gles2::DisallowedExtensions(),
gpu::gles2::DisallowedFeatures(),
NULL,
attribs)) {
return EGL_NO_SURFACE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ bool GLInProcessContext::Initialize(bool onscreen,
if (!decoder_->Initialize(surface_.get(),
context_.get(),
size,
::gpu::gles2::DisallowedExtensions(),
::gpu::gles2::DisallowedFeatures(),
allowed_extensions,
attribs)) {
LOG(ERROR) << "Could not initialize decoder.";
Expand Down

0 comments on commit e82fb79

Please sign in to comment.