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

Unified Diff: gpu/command_buffer/service/framebuffer_manager.cc

Issue 1412613004: Set attachment for bound framebuffer in FramebufferTextureLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix WebGLTextureAttachment::attach Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/framebuffer_manager.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/framebuffer_manager.cc
diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc
index b78a5dcb6bc8976fdda9da4eb4c7e02aa6cd0887..45dc4ef44104da2b0ff994c06d997b14f6ca2b26 100644
--- a/gpu/command_buffer/service/framebuffer_manager.cc
+++ b/gpu/command_buffer/service/framebuffer_manager.cc
@@ -107,11 +107,13 @@ class TextureAttachment
: public Framebuffer::Attachment {
public:
TextureAttachment(
- TextureRef* texture_ref, GLenum target, GLint level, GLsizei samples)
+ TextureRef* texture_ref, GLenum target, GLint level,
+ GLsizei samples, GLint layer)
: texture_ref_(texture_ref),
target_(target),
level_(level),
- samples_(samples) {
+ samples_(samples),
+ layer_(layer) {
}
GLsizei width() const override {
@@ -148,6 +150,8 @@ class TextureAttachment
GLsizei samples() const override { return samples_; }
+ GLint layer() const { return layer_; }
+
GLuint object_name() const override { return texture_ref_->client_id(); }
bool cleared() const override {
@@ -234,6 +238,7 @@ class TextureAttachment
GLenum target_;
GLint level_;
GLsizei samples_;
+ GLint layer_;
DISALLOW_COPY_AND_ASSIGN(TextureAttachment);
};
@@ -689,7 +694,23 @@ void Framebuffer::AttachTexture(
a->DetachFromFramebuffer(this);
if (texture_ref) {
attachments_[attachment] = scoped_refptr<Attachment>(
- new TextureAttachment(texture_ref, target, level, samples));
+ new TextureAttachment(texture_ref, target, level, samples, 0));
+ texture_ref->texture()->AttachToFramebuffer();
+ } else {
+ attachments_.erase(attachment);
+ }
+ framebuffer_complete_state_count_id_ = 0;
+}
+
+void Framebuffer::AttachTextureLayer(
+ GLenum attachment, TextureRef* texture_ref, GLenum target,
+ GLint level, GLint layer) {
+ const Attachment* a = GetAttachment(attachment);
+ if (a)
+ a->DetachFromFramebuffer(this);
+ if (texture_ref) {
+ attachments_[attachment] = scoped_refptr<Attachment>(
+ new TextureAttachment(texture_ref, target, level, 0, layer));
texture_ref->texture()->AttachToFramebuffer();
} else {
attachments_.erase(attachment);
« no previous file with comments | « gpu/command_buffer/service/framebuffer_manager.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698