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

Side by Side Diff: gpu/command_buffer/service/texture_manager.cc

Issue 8669008: DestroyStreamTextureChromium should not disallow rendering (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fixing the DCHECK instead Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/texture_manager.h" 5 #include "gpu/command_buffer/service/texture_manager.h"
6 #include "base/bits.h" 6 #include "base/bits.h"
7 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 7 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
8 #include "gpu/command_buffer/service/feature_info.h" 8 #include "gpu/command_buffer/service/feature_info.h"
9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 9 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 info1.format, 136 info1.format,
137 info1.type, 137 info1.type,
138 true); 138 true);
139 } 139 }
140 } 140 }
141 141
142 return true; 142 return true;
143 } 143 }
144 144
145 void TextureManager::TextureInfo::SetTarget(GLenum target, GLint max_levels) { 145 void TextureManager::TextureInfo::SetTarget(GLenum target, GLint max_levels) {
146 DCHECK_EQ(0u, target_); // you can only set this once. 146 // You can only set target_ once for textures that are not
147 // GL_TEXTURE_EXTERNAL_OES .
148 DCHECK(0u == target_ || GL_TEXTURE_EXTERNAL_OES == target_);
147 target_ = target; 149 target_ = target;
148 size_t num_faces = (target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; 150 size_t num_faces = (target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
149 level_infos_.resize(num_faces); 151 level_infos_.resize(num_faces);
150 for (size_t ii = 0; ii < num_faces; ++ii) { 152 for (size_t ii = 0; ii < num_faces; ++ii) {
151 level_infos_[ii].resize(max_levels); 153 level_infos_[ii].resize(max_levels);
152 } 154 }
153 155
154 if (target == GL_TEXTURE_EXTERNAL_OES) { 156 if (target == GL_TEXTURE_EXTERNAL_OES) {
155 min_filter_ = GL_LINEAR; 157 min_filter_ = GL_LINEAR;
156 wrap_s_ = wrap_t_ = GL_CLAMP_TO_EDGE; 158 wrap_s_ = wrap_t_ = GL_CLAMP_TO_EDGE;
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 return true; 839 return true;
838 } 840 }
839 } 841 }
840 return false; 842 return false;
841 } 843 }
842 844
843 } // namespace gles2 845 } // namespace gles2
844 } // namespace gpu 846 } // namespace gpu
845 847
846 848
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698