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

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

Issue 2302323002: Reset PIXEL_UNPACK_BUFFER at texture manager initialization time (Closed)
Patch Set: reset at TextureManager::Initialize time Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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/texture_manager.h" 5 #include "gpu/command_buffer/service/texture_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after
1774 num_images_(0), 1774 num_images_(0),
1775 texture_count_(0), 1775 texture_count_(0),
1776 have_context_(true), 1776 have_context_(true),
1777 current_service_id_generation_(0) { 1777 current_service_id_generation_(0) {
1778 for (int ii = 0; ii < kNumDefaultTextures; ++ii) { 1778 for (int ii = 0; ii < kNumDefaultTextures; ++ii) {
1779 black_texture_ids_[ii] = 0; 1779 black_texture_ids_[ii] = 0;
1780 } 1780 }
1781 } 1781 }
1782 1782
1783 bool TextureManager::Initialize() { 1783 bool TextureManager::Initialize() {
1784 // Reset PIXEL_UNPACK_BUFFER to avoid unrelated GL error on some GL drivers.
1785 if (feature_info_->gl_version_info().is_es3_capable) {
qiankun 2016/09/09 09:52:48 Using this other than feature_info_->IsES3Capable(
Zhenyao Mo 2016/09/09 15:17:08 You can use feature_info_->IsES3Capable() here and
qiankun 2016/09/09 18:16:26 For some test cases, if --enable-unsafe-es3-apis i
1786 glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
1787 }
1788
1784 // TODO(gman): The default textures have to be real textures, not the 0 1789 // TODO(gman): The default textures have to be real textures, not the 0
1785 // texture because we simulate non shared resources on top of shared 1790 // texture because we simulate non shared resources on top of shared
1786 // resources and all contexts that share resource share the same default 1791 // resources and all contexts that share resource share the same default
1787 // texture. 1792 // texture.
1788 default_textures_[kTexture2D] = CreateDefaultAndBlackTextures( 1793 default_textures_[kTexture2D] = CreateDefaultAndBlackTextures(
1789 GL_TEXTURE_2D, &black_texture_ids_[kTexture2D]); 1794 GL_TEXTURE_2D, &black_texture_ids_[kTexture2D]);
1790 default_textures_[kCubeMap] = CreateDefaultAndBlackTextures( 1795 default_textures_[kCubeMap] = CreateDefaultAndBlackTextures(
1791 GL_TEXTURE_CUBE_MAP, &black_texture_ids_[kCubeMap]); 1796 GL_TEXTURE_CUBE_MAP, &black_texture_ids_[kCubeMap]);
1792 1797
1793 if (feature_info_->IsES3Enabled()) { 1798 if (feature_info_->IsES3Enabled()) {
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
3395 uint32_t TextureManager::GetServiceIdGeneration() const { 3400 uint32_t TextureManager::GetServiceIdGeneration() const {
3396 return current_service_id_generation_; 3401 return current_service_id_generation_;
3397 } 3402 }
3398 3403
3399 void TextureManager::IncrementServiceIdGeneration() { 3404 void TextureManager::IncrementServiceIdGeneration() {
3400 current_service_id_generation_++; 3405 current_service_id_generation_++;
3401 } 3406 }
3402 3407
3403 } // namespace gles2 3408 } // namespace gles2
3404 } // namespace gpu 3409 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/test_helper.cc ('k') | gpu/command_buffer/service/texture_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698