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

Side by Side Diff: content/common/gpu/client/gl_helper_scaling.cc

Issue 630853003: Replace OVERRIDE and FINAL with override and final in content/common/[a-s]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « content/common/gpu/client/gl_helper.cc ('k') | content/common/gpu/client/gpu_channel_host.h » ('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 "content/common/gpu/client/gl_helper_scaling.h" 5 #include "content/common/gpu/client/gl_helper_scaling.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 157
158 virtual ~ScalerImpl() { 158 virtual ~ScalerImpl() {
159 if (intermediate_texture_) { 159 if (intermediate_texture_) {
160 gl_->DeleteTextures(1, &intermediate_texture_); 160 gl_->DeleteTextures(1, &intermediate_texture_);
161 } 161 }
162 } 162 }
163 163
164 // GLHelperShader::ShaderInterface implementation. 164 // GLHelperShader::ShaderInterface implementation.
165 virtual void Execute(GLuint source_texture, 165 virtual void Execute(GLuint source_texture,
166 const std::vector<GLuint>& dest_textures) OVERRIDE { 166 const std::vector<GLuint>& dest_textures) override {
167 if (subscaler_) { 167 if (subscaler_) {
168 subscaler_->Scale(source_texture, intermediate_texture_); 168 subscaler_->Scale(source_texture, intermediate_texture_);
169 source_texture = intermediate_texture_; 169 source_texture = intermediate_texture_;
170 } 170 }
171 171
172 ScopedFramebufferBinder<GL_FRAMEBUFFER> framebuffer_binder( 172 ScopedFramebufferBinder<GL_FRAMEBUFFER> framebuffer_binder(
173 gl_, dst_framebuffer_); 173 gl_, dst_framebuffer_);
174 DCHECK_GT(dest_textures.size(), 0U); 174 DCHECK_GT(dest_textures.size(), 0U);
175 scoped_ptr<GLenum[]> buffers(new GLenum[dest_textures.size()]); 175 scoped_ptr<GLenum[]> buffers(new GLenum[dest_textures.size()]);
176 for (size_t t = 0; t < dest_textures.size(); t++) { 176 for (size_t t = 0; t < dest_textures.size(); t++) {
(...skipping 30 matching lines...) Expand all
207 } 207 }
208 // Conduct texture mapping by drawing a quad composed of two triangles. 208 // Conduct texture mapping by drawing a quad composed of two triangles.
209 gl_->DrawArrays(GL_TRIANGLE_STRIP, 0, 4); 209 gl_->DrawArrays(GL_TRIANGLE_STRIP, 0, 4);
210 if (dest_textures.size() > 1) { 210 if (dest_textures.size() > 1) {
211 // Set the draw buffers back to not confuse others. 211 // Set the draw buffers back to not confuse others.
212 gl_->DrawBuffersEXT(1, &buffers[0]); 212 gl_->DrawBuffersEXT(1, &buffers[0]);
213 } 213 }
214 } 214 }
215 215
216 // GLHelper::ScalerInterface implementation. 216 // GLHelper::ScalerInterface implementation.
217 virtual void Scale(GLuint source_texture, GLuint dest_texture) OVERRIDE { 217 virtual void Scale(GLuint source_texture, GLuint dest_texture) override {
218 std::vector<GLuint> tmp(1); 218 std::vector<GLuint> tmp(1);
219 tmp[0] = dest_texture; 219 tmp[0] = dest_texture;
220 Execute(source_texture, tmp); 220 Execute(source_texture, tmp);
221 } 221 }
222 222
223 virtual const gfx::Size& SrcSize() OVERRIDE { 223 virtual const gfx::Size& SrcSize() override {
224 if (subscaler_) { 224 if (subscaler_) {
225 return subscaler_->SrcSize(); 225 return subscaler_->SrcSize();
226 } 226 }
227 return spec_.src_size; 227 return spec_.src_size;
228 } 228 }
229 virtual const gfx::Rect& SrcSubrect() OVERRIDE { 229 virtual const gfx::Rect& SrcSubrect() override {
230 if (subscaler_) { 230 if (subscaler_) {
231 return subscaler_->SrcSubrect(); 231 return subscaler_->SrcSubrect();
232 } 232 }
233 return spec_.src_subrect; 233 return spec_.src_subrect;
234 } 234 }
235 virtual const gfx::Size& DstSize() OVERRIDE { return spec_.dst_size; } 235 virtual const gfx::Size& DstSize() override { return spec_.dst_size; }
236 236
237 private: 237 private:
238 GLES2Interface* gl_; 238 GLES2Interface* gl_;
239 GLHelperScaling* scaler_helper_; 239 GLHelperScaling* scaler_helper_;
240 GLHelperScaling::ScalerStage spec_; 240 GLHelperScaling::ScalerStage spec_;
241 GLfloat color_weights_[4]; 241 GLfloat color_weights_[4];
242 GLuint intermediate_texture_; 242 GLuint intermediate_texture_;
243 scoped_refptr<ShaderProgram> shader_program_; 243 scoped_refptr<ShaderProgram> shader_program_;
244 ScopedFramebuffer dst_framebuffer_; 244 ScopedFramebuffer dst_framebuffer_;
245 scoped_ptr<ScalerImpl> subscaler_; 245 scoped_ptr<ScalerImpl> subscaler_;
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 gl_->Uniform2f(dst_pixelsize_location_, 920 gl_->Uniform2f(dst_pixelsize_location_,
921 static_cast<float>(dst_size.width()), 921 static_cast<float>(dst_size.width()),
922 static_cast<float>(dst_size.height())); 922 static_cast<float>(dst_size.height()));
923 923
924 gl_->Uniform2f( 924 gl_->Uniform2f(
925 scaling_vector_location_, scale_x ? 1.0 : 0.0, scale_x ? 0.0 : 1.0); 925 scaling_vector_location_, scale_x ? 1.0 : 0.0, scale_x ? 0.0 : 1.0);
926 gl_->Uniform4fv(color_weights_location_, 1, color_weights); 926 gl_->Uniform4fv(color_weights_location_, 1, color_weights);
927 } 927 }
928 928
929 } // namespace content 929 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/gl_helper.cc ('k') | content/common/gpu/client/gpu_channel_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698