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

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

Issue 2418433002: Use gfx::Rect::Intersect() to clip for CopyTex{Sub}Image functions. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | 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) 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 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 GLsizei width, 1108 GLsizei width,
1109 GLsizei height, 1109 GLsizei height,
1110 GLsizei depth) const { 1110 GLsizei depth) const {
1111 size_t face_index = GLES2Util::GLTargetToFaceIndex(target); 1111 size_t face_index = GLES2Util::GLTargetToFaceIndex(target);
1112 if (level >= 0 && face_index < face_infos_.size() && 1112 if (level >= 0 && face_index < face_infos_.size() &&
1113 static_cast<size_t>(level) < face_infos_[face_index].level_infos.size()) { 1113 static_cast<size_t>(level) < face_infos_[face_index].level_infos.size()) {
1114 const LevelInfo& info = face_infos_[face_index].level_infos[level]; 1114 const LevelInfo& info = face_infos_[face_index].level_infos[level];
1115 int32_t max_x; 1115 int32_t max_x;
1116 int32_t max_y; 1116 int32_t max_y;
1117 int32_t max_z; 1117 int32_t max_z;
1118 return SafeAddInt32(xoffset, width, &max_x) && 1118 return xoffset >= 0 &&
1119 yoffset >= 0 &&
1120 zoffset >= 0 &&
1121 width >= 0 &&
1122 height >= 0 &&
1123 depth >= 0 &&
1124 SafeAddInt32(xoffset, width, &max_x) &&
1119 SafeAddInt32(yoffset, height, &max_y) && 1125 SafeAddInt32(yoffset, height, &max_y) &&
1120 SafeAddInt32(zoffset, depth, &max_z) && 1126 SafeAddInt32(zoffset, depth, &max_z) &&
1121 xoffset >= 0 &&
1122 yoffset >= 0 &&
1123 zoffset >= 0 &&
1124 max_x <= info.width && 1127 max_x <= info.width &&
1125 max_y <= info.height && 1128 max_y <= info.height &&
1126 max_z <= info.depth; 1129 max_z <= info.depth;
1127 } 1130 }
1128 return false; 1131 return false;
1129 } 1132 }
1130 1133
1131 bool Texture::GetLevelSize( 1134 bool Texture::GetLevelSize(
1132 GLint target, GLint level, 1135 GLint target, GLint level,
1133 GLsizei* width, GLsizei* height, GLsizei* depth) const { 1136 GLsizei* width, GLsizei* height, GLsizei* depth) const {
(...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after
3477 uint32_t TextureManager::GetServiceIdGeneration() const { 3480 uint32_t TextureManager::GetServiceIdGeneration() const {
3478 return current_service_id_generation_; 3481 return current_service_id_generation_;
3479 } 3482 }
3480 3483
3481 void TextureManager::IncrementServiceIdGeneration() { 3484 void TextureManager::IncrementServiceIdGeneration() {
3482 current_service_id_generation_++; 3485 current_service_id_generation_++;
3483 } 3486 }
3484 3487
3485 } // namespace gles2 3488 } // namespace gles2
3486 } // namespace gpu 3489 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698