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

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

Issue 168983005: Do not rely on a texture's internalformat matching format (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add unit tests for TexSubImage2D on GLES3 Created 6 years, 10 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 #include "base/bits.h" 6 #include "base/bits.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
9 #include "gpu/command_buffer/service/context_state.h" 9 #include "gpu/command_buffer/service/context_state.h"
10 #include "gpu/command_buffer/service/error_state.h" 10 #include "gpu/command_buffer/service/error_state.h"
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 info.width == 0 || 773 info.width == 0 ||
774 info.height == 0 || 774 info.height == 0 ||
775 info.depth == 0) { 775 info.depth == 0) {
776 return true; 776 return true;
777 } 777 }
778 778
779 // NOTE: It seems kind of gross to call back into the decoder for this 779 // NOTE: It seems kind of gross to call back into the decoder for this
780 // but only the decoder knows all the state (like unpack_alignment_) that's 780 // but only the decoder knows all the state (like unpack_alignment_) that's
781 // needed to be able to call GL correctly. 781 // needed to be able to call GL correctly.
782 bool cleared = decoder->ClearLevel( 782 bool cleared = decoder->ClearLevel(
783 service_id_, target_, info.target, info.level, info.format, info.type, 783 service_id_, target_, info.target, info.level, info.internal_format,
784 info.width, info.height, immutable_); 784 info.format, info.type, info.width, info.height, immutable_);
785 UpdateMipCleared(&info, cleared); 785 UpdateMipCleared(&info, cleared);
786 return info.cleared; 786 return info.cleared;
787 } 787 }
788 788
789 void Texture::SetLevelImage( 789 void Texture::SetLevelImage(
790 const FeatureInfo* feature_info, 790 const FeatureInfo* feature_info,
791 GLenum target, 791 GLenum target,
792 GLint level, 792 GLint level,
793 gfx::GLImage* image) { 793 gfx::GLImage* image) {
794 DCHECK_GE(level, 0); 794 DCHECK_GE(level, 0);
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 } 1493 }
1494 1494
1495 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { 1495 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() {
1496 texture_state_->texture_upload_count++; 1496 texture_state_->texture_upload_count++;
1497 texture_state_->total_texture_upload_time += 1497 texture_state_->total_texture_upload_time +=
1498 base::TimeTicks::HighResNow() - begin_time_; 1498 base::TimeTicks::HighResNow() - begin_time_;
1499 } 1499 }
1500 1500
1501 } // namespace gles2 1501 } // namespace gles2
1502 } // namespace gpu 1502 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.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