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

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

Issue 6359009: Get correct backbuffer format when context is on screen.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
===================================================================
--- gpu/command_buffer/service/gles2_cmd_decoder.cc (revision 72177)
+++ gpu/command_buffer/service/gles2_cmd_decoder.cc (working copy)
@@ -1426,6 +1426,9 @@
scoped_ptr<Callback1<gfx::Size>::Type> resize_callback_;
scoped_ptr<Callback0::Type> swap_buffers_callback_;
+ // The format of the back buffer_
+ GLenum back_buffer_color_format_;
+
// The last error message set.
std::string last_error_;
@@ -1756,6 +1759,7 @@
offscreen_target_stencil_format_(0),
offscreen_target_samples_(0),
offscreen_saved_color_format_(0),
+ back_buffer_color_format_(0),
current_decoder_error_(error::kNoError),
use_shader_translator_(true),
validators_(group_->feature_info()->validators()),
@@ -1814,6 +1818,10 @@
vertex_attrib_manager_.Initialize(group_->max_vertex_attribs());
+ GLint v = 0;
+ glGetIntegerv(GL_ALPHA_BITS, &v);
+ back_buffer_color_format_ = v ? GL_RGBA : GL_RGB;
+
// We have to enable vertex array 0 on OpenGL or it won't render. Note that
// OpenGL ES 2.0 does not have this issue.
glEnableVertexAttribArray(0);
@@ -2223,8 +2231,7 @@
} else if (offscreen_target_frame_buffer_.get()) {
return offscreen_target_color_format_;
} else {
- // TODO(gman): return correct format
- return GL_RGBA;
+ return back_buffer_color_format_;
}
}
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698