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/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bits.h" | 10 #include "base/bits.h" |
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 void TextureManager::SetParameterf( | 1286 void TextureManager::SetParameterf( |
1287 const char* function_name, ErrorState* error_state, | 1287 const char* function_name, ErrorState* error_state, |
1288 TextureRef* ref, GLenum pname, GLfloat param) { | 1288 TextureRef* ref, GLenum pname, GLfloat param) { |
1289 DCHECK(error_state); | 1289 DCHECK(error_state); |
1290 DCHECK(ref); | 1290 DCHECK(ref); |
1291 Texture* texture = ref->texture(); | 1291 Texture* texture = ref->texture(); |
1292 GLenum result = texture->SetParameterf(feature_info_.get(), pname, param); | 1292 GLenum result = texture->SetParameterf(feature_info_.get(), pname, param); |
1293 if (result != GL_NO_ERROR) { | 1293 if (result != GL_NO_ERROR) { |
1294 if (result == GL_INVALID_ENUM) { | 1294 if (result == GL_INVALID_ENUM) { |
1295 ERRORSTATE_SET_GL_ERROR_INVALID_ENUM( | 1295 ERRORSTATE_SET_GL_ERROR_INVALID_ENUM( |
1296 error_state, function_name, param, "param"); | 1296 error_state, function_name, pname, "pname"); |
1297 } else { | 1297 } else { |
1298 ERRORSTATE_SET_GL_ERROR_INVALID_PARAMF( | 1298 ERRORSTATE_SET_GL_ERROR_INVALID_PARAMF( |
1299 error_state, result, function_name, pname, param); | 1299 error_state, result, function_name, pname, param); |
1300 } | 1300 } |
1301 } else { | 1301 } else { |
1302 // Texture tracking pools exist only for the command decoder, so | 1302 // Texture tracking pools exist only for the command decoder, so |
1303 // do not pass them on to the native GL implementation. | 1303 // do not pass them on to the native GL implementation. |
1304 if (pname != GL_TEXTURE_POOL_CHROMIUM) { | 1304 if (pname != GL_TEXTURE_POOL_CHROMIUM) { |
1305 glTexParameterf(texture->target(), pname, param); | 1305 glTexParameterf(texture->target(), pname, param); |
1306 } | 1306 } |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1720 } | 1720 } |
1721 | 1721 |
1722 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { | 1722 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { |
1723 texture_state_->texture_upload_count++; | 1723 texture_state_->texture_upload_count++; |
1724 texture_state_->total_texture_upload_time += | 1724 texture_state_->total_texture_upload_time += |
1725 base::TimeTicks::HighResNow() - begin_time_; | 1725 base::TimeTicks::HighResNow() - begin_time_; |
1726 } | 1726 } |
1727 | 1727 |
1728 } // namespace gles2 | 1728 } // namespace gles2 |
1729 } // namespace gpu | 1729 } // namespace gpu |
OLD | NEW |