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

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

Issue 976063002: Cherry pick fix for bug 461847. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2272
Patch Set: Created 5 years, 9 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 | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | 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/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 9122 matching lines...) Expand 10 before | Expand all | Expand 10 after
9133 9133
9134 ScopedResolvedFrameBufferBinder binder(this, false, true); 9134 ScopedResolvedFrameBufferBinder binder(this, false, true);
9135 gfx::Size size = GetBoundReadFrameBufferSize(); 9135 gfx::Size size = GetBoundReadFrameBufferSize();
9136 GLint copyX = 0; 9136 GLint copyX = 0;
9137 GLint copyY = 0; 9137 GLint copyY = 0;
9138 GLint copyWidth = 0; 9138 GLint copyWidth = 0;
9139 GLint copyHeight = 0; 9139 GLint copyHeight = 0;
9140 Clip(x, width, size.width(), &copyX, &copyWidth); 9140 Clip(x, width, size.width(), &copyX, &copyWidth);
9141 Clip(y, height, size.height(), &copyY, &copyHeight); 9141 Clip(y, height, size.height(), &copyY, &copyHeight);
9142 9142
9143 if (!texture_manager()->ClearTextureLevel(this, texture_ref, target, level)) { 9143 if (xoffset != 0 || yoffset != 0 || width != size.width() ||
9144 LOCAL_SET_GL_ERROR( 9144 height != size.height()) {
9145 GL_OUT_OF_MEMORY, "glCopyTexSubImage2D", "dimensions too big"); 9145 if (!texture_manager()->ClearTextureLevel(this, texture_ref, target,
9146 return; 9146 level)) {
9147 LOCAL_SET_GL_ERROR(GL_OUT_OF_MEMORY, "glCopyTexSubImage2D",
9148 "dimensions too big");
9149 return;
9150 }
9151 } else {
9152 // Write all pixels in below.
9153 texture_manager()->SetLevelCleared(texture_ref, target, level, true);
9147 } 9154 }
9148 9155
9149 if (copyX != x || 9156 if (copyX != x ||
9150 copyY != y || 9157 copyY != y ||
9151 copyWidth != width || 9158 copyWidth != width ||
9152 copyHeight != height) { 9159 copyHeight != height) {
9153 // some part was clipped so clear the sub rect. 9160 // some part was clipped so clear the sub rect.
9154 uint32 pixels_size = 0; 9161 uint32 pixels_size = 0;
9155 if (!GLES2Util::ComputeImageDataSizes( 9162 if (!GLES2Util::ComputeImageDataSizes(
9156 width, height, 1, format, type, state_.unpack_alignment, &pixels_size, 9163 width, height, 1, format, type, state_.unpack_alignment, &pixels_size,
(...skipping 2478 matching lines...) Expand 10 before | Expand all | Expand 10 after
11635 } 11642 }
11636 } 11643 }
11637 11644
11638 // Include the auto-generated part of this file. We split this because it means 11645 // Include the auto-generated part of this file. We split this because it means
11639 // we can easily edit the non-auto generated parts right here in this file 11646 // we can easily edit the non-auto generated parts right here in this file
11640 // instead of having to edit some template or the code generator. 11647 // instead of having to edit some template or the code generator.
11641 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 11648 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
11642 11649
11643 } // namespace gles2 11650 } // namespace gles2
11644 } // namespace gpu 11651 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder_unittest_textures.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698