diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-05 05:50:55 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-05 05:50:55 +0000 |
commit | 262305fd778460f7bb3db1723255fff4845e2292 (patch) | |
tree | 39f79fd8f5ca10fc8b67f138a4c05b3baed732b0 /webkit/common | |
parent | 51b773981ef3537f8ad4d00b67c9a9616c849cd3 (diff) | |
download | chromium_src-262305fd778460f7bb3db1723255fff4845e2292.zip chromium_src-262305fd778460f7bb3db1723255fff4845e2292.tar.gz chromium_src-262305fd778460f7bb3db1723255fff4845e2292.tar.bz2 |
Remove uncalled blink::WGC3D::getContextAttribute implementations
Once https://codereview.chromium.org/293363013/ lands blink will never call
getContextAttribute() so there is no need to implement this function or to query
the alpha/depth/stencil/sample state from the default framebuffer.
R=kbr@chromium.org
BUG=378018
Review URL: https://codereview.chromium.org/301563007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/common')
4 files changed, 14 insertions, 43 deletions
diff --git a/webkit/common/gpu/webgraphicscontext3d_impl.cc b/webkit/common/gpu/webgraphicscontext3d_impl.cc index e93bceb..0c08d17 100644 --- a/webkit/common/gpu/webgraphicscontext3d_impl.cc +++ b/webkit/common/gpu/webgraphicscontext3d_impl.cc @@ -148,17 +148,13 @@ rt WebGraphicsContext3DImpl::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, \ return gl_->glname(a1, a2, a3, a4, a5, a6, a7, a8, a9); \ } -WebGraphicsContext3DImpl::WebGraphicsContext3DImpl( - const Attributes& attributes, - bool lose_context_when_out_of_memory) +WebGraphicsContext3DImpl::WebGraphicsContext3DImpl() : initialized_(false), initialize_failed_(false), context_lost_callback_(0), context_lost_reason_(GL_NO_ERROR), error_message_callback_(0), - attributes_(attributes), gl_(NULL), - lose_context_when_out_of_memory_(lose_context_when_out_of_memory), flush_id_(0) { } @@ -405,11 +401,6 @@ DELEGATE_TO_GL_2(getBooleanv, GetBooleanv, WGC3Denum, WGC3Dboolean*) DELEGATE_TO_GL_3(getBufferParameteriv, GetBufferParameteriv, WGC3Denum, WGC3Denum, WGC3Dint*) -blink::WebGraphicsContext3D::Attributes -WebGraphicsContext3DImpl::getContextAttributes() { - return attributes_; -} - WGC3Denum WebGraphicsContext3DImpl::getError() { if (!synthetic_errors_.empty()) { std::vector<WGC3Denum>::iterator iter = synthetic_errors_.begin(); diff --git a/webkit/common/gpu/webgraphicscontext3d_impl.h b/webkit/common/gpu/webgraphicscontext3d_impl.h index 5444978..8bb9067 100644 --- a/webkit/common/gpu/webgraphicscontext3d_impl.h +++ b/webkit/common/gpu/webgraphicscontext3d_impl.h @@ -177,8 +177,6 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DImpl WGC3Denum pname, WGC3Dint* value); - virtual Attributes getContextAttributes(); - virtual WGC3Denum getError(); virtual void getFloatv(WGC3Denum pname, WGC3Dfloat* value); @@ -560,9 +558,7 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DImpl protected: friend class WebGraphicsContext3DErrorMessageCallback; - WebGraphicsContext3DImpl( - const Attributes& attributes, - bool lose_context_when_out_of_memory); + WebGraphicsContext3DImpl(); virtual ~WebGraphicsContext3DImpl(); ::gpu::gles2::GLES2ImplementationErrorMessageCallback* @@ -584,8 +580,6 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DImpl scoped_ptr<WebGraphicsContext3DErrorMessageCallback> client_error_message_callback_; - blink::WebGraphicsContext3D::Attributes attributes_; - // Errors raised by synthesizeGLError(). std::vector<WGC3Denum> synthetic_errors_; diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index d11c9d0..3ce34fe 100644 --- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -19,7 +19,6 @@ #include "base/callback.h" #include "base/lazy_instance.h" #include "base/logging.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_lib.h" #include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h" @@ -112,10 +111,13 @@ WebGraphicsContext3DInProcessCommandBufferImpl:: bool lose_context_when_out_of_memory, bool is_offscreen, gfx::AcceleratedWidget window) - : WebGraphicsContext3DImpl(attributes, lose_context_when_out_of_memory), + : share_resources_(attributes.shareResources), + webgl_context_(attributes.noExtensions), is_offscreen_(is_offscreen), window_(window), context_(context.Pass()) { + ConvertAttributes(attributes, &attribs_); + attribs_.lose_context_when_out_of_memory = lose_context_when_out_of_memory; } WebGraphicsContext3DInProcessCommandBufferImpl:: @@ -153,17 +155,12 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { // discrete GPU is created, or the last one is destroyed. gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; - ::gpu::GLInProcessContextAttribs attrib_struct; - ConvertAttributes(attributes_, &attrib_struct); - attrib_struct.lose_context_when_out_of_memory = - lose_context_when_out_of_memory_; - context_.reset(GLInProcessContext::CreateContext( is_offscreen_, window_, gfx::Size(1, 1), - attributes_.shareResources, - attrib_struct, + share_resources_, + attribs_, gpu_preference)); } @@ -180,25 +177,9 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { real_gl_ = context_->GetImplementation(); setGLInterface(real_gl_); - if (real_gl_ && attributes_.noExtensions) + if (real_gl_ && webgl_context_) real_gl_->EnableFeatureCHROMIUM("webgl_enable_glsl_webgl_validation"); - // Set attributes_ from created offscreen context. - { - GLint alpha_bits = 0; - getIntegerv(GL_ALPHA_BITS, &alpha_bits); - attributes_.alpha = alpha_bits > 0; - GLint depth_bits = 0; - getIntegerv(GL_DEPTH_BITS, &depth_bits); - attributes_.depth = depth_bits > 0; - GLint stencil_bits = 0; - getIntegerv(GL_STENCIL_BITS, &stencil_bits); - attributes_.stencil = stencil_bits > 0; - GLint sample_buffers = 0; - getIntegerv(GL_SAMPLE_BUFFERS, &sample_buffers); - attributes_.antialias = sample_buffers > 0; - } - initialized_ = true; return true; } diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h index d435c62..5ab1a17 100644 --- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h +++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h @@ -9,6 +9,7 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" +#include "gpu/command_buffer/client/gl_in_process_context.h" #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" #include "third_party/WebKit/public/platform/WebString.h" #include "ui/gfx/native_widget_types.h" @@ -89,6 +90,10 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl // instead of going through WebGraphicsContext3D. void ClearContext(); + ::gpu::GLInProcessContextAttribs attribs_; + bool share_resources_; + bool webgl_context_; + bool is_offscreen_; // Only used when not offscreen. gfx::AcceleratedWidget window_; |