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

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

Issue 14858022: gpu: Make sure external texture destination is initialized (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add TODO. Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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/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 9609 matching lines...) Expand 10 before | Expand all | Expand 10 after
9620 bool dest_level_defined = dest_texture->GetLevelSize( 9620 bool dest_level_defined = dest_texture->GetLevelSize(
9621 GL_TEXTURE_2D, level, &dest_width, &dest_height); 9621 GL_TEXTURE_2D, level, &dest_width, &dest_height);
9622 9622
9623 if (dest_level_defined) { 9623 if (dest_level_defined) {
9624 dest_texture->GetLevelType(GL_TEXTURE_2D, level, &dest_type_previous, 9624 dest_texture->GetLevelType(GL_TEXTURE_2D, level, &dest_type_previous,
9625 &dest_internal_format); 9625 &dest_internal_format);
9626 } 9626 }
9627 9627
9628 // Set source texture's width and height to be the same as 9628 // Set source texture's width and height to be the same as
9629 // destination texture when source is GL_TEXTURE_EXTERNAL_OES. 9629 // destination texture when source is GL_TEXTURE_EXTERNAL_OES.
9630 // TODO(hkuang): Add support to get width/height of StreamTexture
9631 // crbug.com/225781.
9630 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) { 9632 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) {
9633 if (!dest_level_defined) {
9634 LOCAL_SET_GL_ERROR(
9635 GL_INVALID_VALUE,
9636 "glCopyTextureCHROMIUM", "destination level not defined");
9637 return;
9638 }
9631 source_width = dest_width; 9639 source_width = dest_width;
9632 source_height = dest_height; 9640 source_height = dest_height;
9633 } 9641 }
9634 9642
9635 // Resize the destination texture to the dimensions of the source texture. 9643 // Resize the destination texture to the dimensions of the source texture.
9636 if (!dest_level_defined || dest_width != source_width || 9644 if (!dest_level_defined || dest_width != source_width ||
9637 dest_height != source_height || 9645 dest_height != source_height ||
9638 dest_internal_format != internal_format || 9646 dest_internal_format != internal_format ||
9639 dest_type_previous != dest_type) { 9647 dest_type_previous != dest_type) {
9640 // Ensure that the glTexImage2D succeeds. 9648 // Ensure that the glTexImage2D succeeds.
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
10332 return error::kNoError; 10340 return error::kNoError;
10333 } 10341 }
10334 10342
10335 // Include the auto-generated part of this file. We split this because it means 10343 // Include the auto-generated part of this file. We split this because it means
10336 // we can easily edit the non-auto generated parts right here in this file 10344 // we can easily edit the non-auto generated parts right here in this file
10337 // instead of having to edit some template or the code generator. 10345 // instead of having to edit some template or the code generator.
10338 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 10346 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10339 10347
10340 } // namespace gles2 10348 } // namespace gles2
10341 } // namespace gpu 10349 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698