Commit 9056e73d authored by jamesr@chromium.org's avatar jamesr@chromium.org

Port content::GLHelper over to GLES2Interface

This is necessary to remove the WebGraphicsContext3D getter from
cc::ContextProvider.

TBR=maruel@ for trivial PRESUBMIT.py change
BUG=181120

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243499 0039d316-1c4b-4281-b951-d872f2087c98
parent 557c7b64
...@@ -897,6 +897,8 @@ def _CheckSpamLogging(input_api, output_api): ...@@ -897,6 +897,8 @@ def _CheckSpamLogging(input_api, output_api):
r"^chrome[\\\/]installer[\\\/]setup[\\\/].*", r"^chrome[\\\/]installer[\\\/]setup[\\\/].*",
r"^chrome[\\\/]renderer[\\\/]extensions[\\\/]" r"^chrome[\\\/]renderer[\\\/]extensions[\\\/]"
r"logging_native_handler\.cc$", r"logging_native_handler\.cc$",
r"^content[\\\/]common[\\\/]gpu[\\\/]client[\\\/]"
r"gl_helper_benchmark\.cc$",
r"^remoting[\\\/]base[\\\/]logging\.h$", r"^remoting[\\\/]base[\\\/]logging\.h$",
r"^remoting[\\\/]host[\\\/].*", r"^remoting[\\\/]host[\\\/].*",
r"^sandbox[\\\/]linux[\\\/].*", r"^sandbox[\\\/]linux[\\\/].*",
......
...@@ -338,7 +338,7 @@ GLHelper* GpuProcessTransportFactory::GetGLHelper() { ...@@ -338,7 +338,7 @@ GLHelper* GpuProcessTransportFactory::GetGLHelper() {
scoped_refptr<cc::ContextProvider> provider = scoped_refptr<cc::ContextProvider> provider =
SharedMainThreadContextProvider(); SharedMainThreadContextProvider();
if (provider.get()) if (provider.get())
gl_helper_.reset(new GLHelper(provider->Context3d(), gl_helper_.reset(new GLHelper(provider->ContextGL(),
provider->ContextSupport())); provider->ContextSupport()));
} }
return gl_helper_.get(); return gl_helper_.get();
......
...@@ -77,7 +77,7 @@ scoped_refptr<ui::Texture> NoTransportImageTransportFactory::CreateOwnedTexture( ...@@ -77,7 +77,7 @@ scoped_refptr<ui::Texture> NoTransportImageTransportFactory::CreateOwnedTexture(
GLHelper* NoTransportImageTransportFactory::GetGLHelper() { GLHelper* NoTransportImageTransportFactory::GetGLHelper() {
if (!gl_helper_) { if (!gl_helper_) {
context_provider_ = context_factory_->SharedMainThreadContextProvider(); context_provider_ = context_factory_->SharedMainThreadContextProvider();
gl_helper_.reset(new GLHelper(context_provider_->Context3d(), gl_helper_.reset(new GLHelper(context_provider_->ContextGL(),
context_provider_->ContextSupport())); context_provider_->ContextSupport()));
} }
return gl_helper_.get(); return gl_helper_.get();
......
...@@ -88,7 +88,7 @@ void ReflectorImpl::ShutdownOnImplThread() { ...@@ -88,7 +88,7 @@ void ReflectorImpl::ShutdownOnImplThread() {
void ReflectorImpl::AttachToOutputSurface( void ReflectorImpl::AttachToOutputSurface(
BrowserCompositorOutputSurface* output_surface) { BrowserCompositorOutputSurface* output_surface) {
gl_helper_.reset( gl_helper_.reset(
new GLHelper(output_surface->context_provider()->Context3d(), new GLHelper(output_surface->context_provider()->ContextGL(),
output_surface->context_provider()->ContextSupport())); output_surface->context_provider()->ContextSupport()));
output_surface->SetReflector(this); output_surface->SetReflector(this);
} }
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "content/common/gpu/client/gl_helper.h" #include "content/common/gpu/client/gl_helper.h"
#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
#include "content/common/gpu/gpu_process_launch_causes.h" #include "content/common/gpu/gpu_process_launch_causes.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
#include "third_party/khronos/GLES2/gl2.h" #include "third_party/khronos/GLES2/gl2.h"
#include "ui/gfx/android/device_display_info.h" #include "ui/gfx/android/device_display_info.h"
...@@ -144,7 +145,7 @@ void CmdBufferImageTransportFactory::AcquireTexture( ...@@ -144,7 +145,7 @@ void CmdBufferImageTransportFactory::AcquireTexture(
GLHelper* CmdBufferImageTransportFactory::GetGLHelper() { GLHelper* CmdBufferImageTransportFactory::GetGLHelper() {
if (!gl_helper_) if (!gl_helper_)
gl_helper_.reset(new GLHelper(context_.get(), gl_helper_.reset(new GLHelper(context_->GetImplementation(),
context_->GetContextSupport())); context_->GetContextSupport()));
return gl_helper_.get(); return gl_helper_.get();
......
...@@ -2633,7 +2633,7 @@ void RenderWidgetHostViewAura::DidRecreateLayer(ui::Layer *old_layer, ...@@ -2633,7 +2633,7 @@ void RenderWidgetHostViewAura::DidRecreateLayer(ui::Layer *old_layer,
scoped_refptr<ui::Texture> new_texture; scoped_refptr<ui::Texture> new_texture;
if (host_->is_accelerated_compositing_active() && if (host_->is_accelerated_compositing_active() &&
gl_helper && current_surface_.get()) { gl_helper && current_surface_.get()) {
blink::WebGLId texture_id = GLuint texture_id =
gl_helper->CopyTexture(current_surface_->PrepareTexture(), gl_helper->CopyTexture(current_surface_->PrepareTexture(),
current_surface_->size()); current_surface_->size());
if (texture_id) { if (texture_id) {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <deque> #include <deque>
#include <map> #include <map>
#include <queue>
#include "content/browser/renderer_host/render_widget_host_view_aura.h" #include "content/browser/renderer_host/render_widget_host_view_aura.h"
#include "ui/aura/window_observer.h" #include "ui/aura/window_observer.h"
......
This diff is collapsed.
This diff is collapsed.
...@@ -67,9 +67,10 @@ class GLHelperTest : public testing::Test { ...@@ -67,9 +67,10 @@ class GLHelperTest : public testing::Test {
context_->makeContextCurrent(); context_->makeContextCurrent();
helper_.reset( helper_.reset(
new content::GLHelper(context_.get(), context_->GetContextSupport())); new content::GLHelper(context_->GetGLInterface(),
context_->GetContextSupport()));
helper_scaling_.reset(new content::GLHelperScaling( helper_scaling_.reset(new content::GLHelperScaling(
context_.get(), context_->GetGLInterface(),
helper_.get())); helper_.get()));
} }
......
...@@ -5,9 +5,13 @@ ...@@ -5,9 +5,13 @@
#ifndef CONTENT_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_ #ifndef CONTENT_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_
#define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_ #define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_SCALING_H_
#include <deque>
#include <map>
#include <vector> #include <vector>
#include "content/common/gpu/client/gl_helper.h" #include "content/common/gpu/client/gl_helper.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
namespace content { namespace content {
...@@ -41,13 +45,13 @@ class CONTENT_EXPORT GLHelperScaling { ...@@ -41,13 +45,13 @@ class CONTENT_EXPORT GLHelperScaling {
virtual ~ShaderInterface() {} virtual ~ShaderInterface() {}
// Note that the src_texture will have the min/mag filter set to GL_LINEAR // Note that the src_texture will have the min/mag filter set to GL_LINEAR
// and wrap_s/t set to CLAMP_TO_EDGE in this call. // and wrap_s/t set to CLAMP_TO_EDGE in this call.
virtual void Execute(blink::WebGLId source_texture, virtual void Execute(GLuint source_texture,
const std::vector<blink::WebGLId>& dest_textures) = 0; const std::vector<GLuint>& dest_textures) = 0;
}; };
typedef std::pair<ShaderType, bool> ShaderProgramKeyType; typedef std::pair<ShaderType, bool> ShaderProgramKeyType;
GLHelperScaling(blink::WebGraphicsContext3D* context, GLHelperScaling(gpu::gles2::GLES2Interface* gl,
GLHelper* helper); GLHelper* helper);
~GLHelperScaling(); ~GLHelperScaling();
void InitBuffer(); void InitBuffer();
...@@ -182,9 +186,9 @@ class CONTENT_EXPORT GLHelperScaling { ...@@ -182,9 +186,9 @@ class CONTENT_EXPORT GLHelperScaling {
// Interleaved array of 2-dimentional vertex positions (x, y) and // Interleaved array of 2-dimentional vertex positions (x, y) and
// 2-dimentional texture coordinates (s, t). // 2-dimentional texture coordinates (s, t).
static const blink::WGC3Dfloat kVertexAttributes[]; static const GLfloat kVertexAttributes[];
blink::WebGraphicsContext3D* context_; gpu::gles2::GLES2Interface* gl_;
GLHelper* helper_; GLHelper* helper_;
// The buffer that holds the vertices and the texture coordinates data for // The buffer that holds the vertices and the texture coordinates data for
......
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