| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2215 // use whatever we were given. Same for DEPTH and STENCIL. | 2215 // use whatever we were given. Same for DEPTH and STENCIL. |
| 2216 back_buffer_color_format_ = | 2216 back_buffer_color_format_ = |
| 2217 (attrib_parser.alpha_size_ != 0 && v > 0) ? GL_RGBA : GL_RGB; | 2217 (attrib_parser.alpha_size_ != 0 && v > 0) ? GL_RGBA : GL_RGB; |
| 2218 glGetIntegerv(GL_DEPTH_BITS, &v); | 2218 glGetIntegerv(GL_DEPTH_BITS, &v); |
| 2219 back_buffer_has_depth_ = attrib_parser.depth_size_ != 0 && v > 0; | 2219 back_buffer_has_depth_ = attrib_parser.depth_size_ != 0 && v > 0; |
| 2220 glGetIntegerv(GL_STENCIL_BITS, &v); | 2220 glGetIntegerv(GL_STENCIL_BITS, &v); |
| 2221 back_buffer_has_stencil_ = attrib_parser.stencil_size_ != 0 && v > 0; | 2221 back_buffer_has_stencil_ = attrib_parser.stencil_size_ != 0 && v > 0; |
| 2222 | 2222 |
| 2223 if (offscreen) { | 2223 if (offscreen) { |
| 2224 if (attrib_parser.samples_ > 0 && attrib_parser.sample_buffers_ > 0 && | 2224 if (attrib_parser.samples_ > 0 && attrib_parser.sample_buffers_ > 0 && |
| 2225 (context_->HasExtension("GL_EXT_framebuffer_multisample") || | 2225 features().chromium_framebuffer_multisample) { |
| 2226 context_->HasExtension("GL_ANGLE_framebuffer_multisample"))) { | |
| 2227 // Per ext_framebuffer_multisample spec, need max bound on sample count. | 2226 // Per ext_framebuffer_multisample spec, need max bound on sample count. |
| 2228 // max_sample_count must be initialized to a sane value. If | 2227 // max_sample_count must be initialized to a sane value. If |
| 2229 // glGetIntegerv() throws a GL error, it leaves its argument unchanged. | 2228 // glGetIntegerv() throws a GL error, it leaves its argument unchanged. |
| 2230 GLint max_sample_count = 1; | 2229 GLint max_sample_count = 1; |
| 2231 glGetIntegerv(GL_MAX_SAMPLES_EXT, &max_sample_count); | 2230 glGetIntegerv(GL_MAX_SAMPLES_EXT, &max_sample_count); |
| 2232 offscreen_target_samples_ = std::min(attrib_parser.samples_, | 2231 offscreen_target_samples_ = std::min(attrib_parser.samples_, |
| 2233 max_sample_count); | 2232 max_sample_count); |
| 2234 } else { | 2233 } else { |
| 2235 offscreen_target_samples_ = 1; | 2234 offscreen_target_samples_ = 1; |
| 2236 } | 2235 } |
| (...skipping 7499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9736 target, level, xoffset, yoffset, width, height, format, type, pixels); | 9735 target, level, xoffset, yoffset, width, height, format, type, pixels); |
| 9737 } | 9736 } |
| 9738 | 9737 |
| 9739 // Include the auto-generated part of this file. We split this because it means | 9738 // Include the auto-generated part of this file. We split this because it means |
| 9740 // we can easily edit the non-auto generated parts right here in this file | 9739 // we can easily edit the non-auto generated parts right here in this file |
| 9741 // instead of having to edit some template or the code generator. | 9740 // instead of having to edit some template or the code generator. |
| 9742 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 9741 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 9743 | 9742 |
| 9744 } // namespace gles2 | 9743 } // namespace gles2 |
| 9745 } // namespace gpu | 9744 } // namespace gpu |
| OLD | NEW |