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

Unified Diff: cc/output/program_binding.h

Issue 93433004: Use GLES2Interface for shaders and programs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android_aosp warning Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/program_binding.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/program_binding.h
diff --git a/cc/output/program_binding.h b/cc/output/program_binding.h
index 4a75a01e3ba838f4a41b8fb39b8e1870e18266ab..912329ef6bf548055ad6a07de577f12040af4936 100644
--- a/cc/output/program_binding.h
+++ b/cc/output/program_binding.h
@@ -11,7 +11,11 @@
#include "cc/output/context_provider.h"
#include "cc/output/shader.h"
-namespace blink { class WebGraphicsContext3D; }
+namespace gpu {
+namespace gles2 {
+class GLES2Interface;
+}
+}
namespace cc {
@@ -20,23 +24,23 @@ class ProgramBindingBase {
ProgramBindingBase();
~ProgramBindingBase();
- bool Init(blink::WebGraphicsContext3D* context,
+ bool Init(gpu::gles2::GLES2Interface* context,
const std::string& vertex_shader,
const std::string& fragment_shader);
- bool Link(blink::WebGraphicsContext3D* context);
- void Cleanup(blink::WebGraphicsContext3D* context);
+ bool Link(gpu::gles2::GLES2Interface* context);
+ void Cleanup(gpu::gles2::GLES2Interface* context);
unsigned program() const { return program_; }
bool initialized() const { return initialized_; }
protected:
- unsigned LoadShader(blink::WebGraphicsContext3D* context,
+ unsigned LoadShader(gpu::gles2::GLES2Interface* context,
unsigned type,
const std::string& shader_source);
- unsigned CreateShaderProgram(blink::WebGraphicsContext3D* context,
+ unsigned CreateShaderProgram(gpu::gles2::GLES2Interface* context,
unsigned vertex_shader,
unsigned fragment_shader);
- void CleanupShaders(blink::WebGraphicsContext3D* context);
+ void CleanupShaders(gpu::gles2::GLES2Interface* context);
unsigned program_;
unsigned vertex_shader_id_;
@@ -62,7 +66,7 @@ class ProgramBinding : public ProgramBindingBase {
return;
if (!ProgramBindingBase::Init(
- context_provider->Context3d(),
+ context_provider->ContextGL(),
vertex_shader_.GetShaderString(),
fragment_shader_.GetShaderString(precision, sampler))) {
DCHECK(context_provider->IsContextLost());
@@ -70,13 +74,13 @@ class ProgramBinding : public ProgramBindingBase {
}
int base_uniform_index = 0;
- vertex_shader_.Init(context_provider->Context3d(),
+ vertex_shader_.Init(context_provider->ContextGL(),
program_, &base_uniform_index);
- fragment_shader_.Init(context_provider->Context3d(),
+ fragment_shader_.Init(context_provider->ContextGL(),
program_, &base_uniform_index);
// Link after binding uniforms
- if (!Link(context_provider->Context3d())) {
+ if (!Link(context_provider->ContextGL())) {
DCHECK(context_provider->IsContextLost());
return;
}
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/program_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698