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

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

Issue 374193002: gpu: Optimize and cleanup code used for CHROMIUM_copy_texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits Created 6 years, 5 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/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 10071 matching lines...) Expand 10 before | Expand all | Expand 10 after
10082 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) { 10082 if (source_texture->target() == GL_TEXTURE_EXTERNAL_OES) {
10083 // TODO(hkuang): get the StreamTexture transform matrix in GPU process 10083 // TODO(hkuang): get the StreamTexture transform matrix in GPU process
10084 // instead of using default matrix crbug.com/226218. 10084 // instead of using default matrix crbug.com/226218.
10085 const static GLfloat default_matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f, 10085 const static GLfloat default_matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f,
10086 0.0f, 1.0f, 0.0f, 0.0f, 10086 0.0f, 1.0f, 0.0f, 0.0f,
10087 0.0f, 0.0f, 1.0f, 0.0f, 10087 0.0f, 0.0f, 1.0f, 0.0f,
10088 0.0f, 0.0f, 0.0f, 1.0f}; 10088 0.0f, 0.0f, 0.0f, 1.0f};
10089 copy_texture_CHROMIUM_->DoCopyTextureWithTransform( 10089 copy_texture_CHROMIUM_->DoCopyTextureWithTransform(
10090 this, 10090 this,
10091 source_texture->target(), 10091 source_texture->target(),
10092 dest_texture->target(),
10093 source_texture->service_id(), 10092 source_texture->service_id(),
10094 dest_texture->service_id(), level, 10093 dest_texture->service_id(),
10095 source_width, source_height, 10094 level,
10095 source_width,
10096 source_height,
10096 unpack_flip_y_, 10097 unpack_flip_y_,
10097 unpack_premultiply_alpha_, 10098 unpack_premultiply_alpha_,
10098 unpack_unpremultiply_alpha_, 10099 unpack_unpremultiply_alpha_,
10099 default_matrix); 10100 default_matrix);
10100 } else { 10101 } else {
10101 copy_texture_CHROMIUM_->DoCopyTexture( 10102 copy_texture_CHROMIUM_->DoCopyTexture(this,
10102 this, 10103 source_texture->target(),
10103 source_texture->target(), 10104 source_texture->service_id(),
10104 dest_texture->target(), 10105 dest_texture->service_id(),
10105 source_texture->service_id(), 10106 level,
10106 dest_texture->service_id(), level, 10107 internal_format,
10107 source_width, source_height, 10108 source_width,
10108 unpack_flip_y_, 10109 source_height,
10109 unpack_premultiply_alpha_, 10110 unpack_flip_y_,
10110 unpack_unpremultiply_alpha_); 10111 unpack_premultiply_alpha_,
10112 unpack_unpremultiply_alpha_);
10111 } 10113 }
10112 10114
10113 DoDidUseTexImageIfNeeded(source_texture, source_texture->target()); 10115 DoDidUseTexImageIfNeeded(source_texture, source_texture->target());
10114 } 10116 }
10115 10117
10116 static GLenum ExtractTypeFromStorageFormat(GLenum internalformat) { 10118 static GLenum ExtractTypeFromStorageFormat(GLenum internalformat) {
10117 switch (internalformat) { 10119 switch (internalformat) {
10118 case GL_RGB565: 10120 case GL_RGB565:
10119 return GL_UNSIGNED_SHORT_5_6_5; 10121 return GL_UNSIGNED_SHORT_5_6_5;
10120 case GL_RGBA4: 10122 case GL_RGBA4:
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
10916 } 10918 }
10917 } 10919 }
10918 10920
10919 // Include the auto-generated part of this file. We split this because it means 10921 // Include the auto-generated part of this file. We split this because it means
10920 // we can easily edit the non-auto generated parts right here in this file 10922 // we can easily edit the non-auto generated parts right here in this file
10921 // instead of having to edit some template or the code generator. 10923 // instead of having to edit some template or the code generator.
10922 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 10924 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10923 10925
10924 } // namespace gles2 10926 } // namespace gles2
10925 } // namespace gpu 10927 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698