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

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

Issue 16294003: Update content/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | « content/common/child_thread.cc ('k') | content/common/gpu/client/gpu_channel_host.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 "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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 sizeof(kVertexAttributes), 482 sizeof(kVertexAttributes),
483 kVertexAttributes, 483 kVertexAttributes,
484 GL_STATIC_DRAW); 484 GL_STATIC_DRAW);
485 } 485 }
486 486
487 scoped_refptr<ShaderProgram> 487 scoped_refptr<ShaderProgram>
488 GLHelperScaling::GetShaderProgram(ShaderType type, 488 GLHelperScaling::GetShaderProgram(ShaderType type,
489 bool swizzle) { 489 bool swizzle) {
490 ShaderProgramKeyType key(type, swizzle); 490 ShaderProgramKeyType key(type, swizzle);
491 scoped_refptr<ShaderProgram>& cache_entry(shader_programs_[key]); 491 scoped_refptr<ShaderProgram>& cache_entry(shader_programs_[key]);
492 if (!cache_entry) { 492 if (!cache_entry.get()) {
493 cache_entry = new ShaderProgram(context_, helper_); 493 cache_entry = new ShaderProgram(context_, helper_);
494 std::basic_string<WebKit::WGC3Dchar> vertex_program; 494 std::basic_string<WebKit::WGC3Dchar> vertex_program;
495 std::basic_string<WebKit::WGC3Dchar> fragment_program; 495 std::basic_string<WebKit::WGC3Dchar> fragment_program;
496 std::basic_string<WebKit::WGC3Dchar> vertex_header; 496 std::basic_string<WebKit::WGC3Dchar> vertex_header;
497 std::basic_string<WebKit::WGC3Dchar> fragment_header; 497 std::basic_string<WebKit::WGC3Dchar> fragment_header;
498 std::basic_string<WebKit::WGC3Dchar> shared_variables; 498 std::basic_string<WebKit::WGC3Dchar> shared_variables;
499 499
500 vertex_header.append( 500 vertex_header.append(
501 "precision highp float;\n" 501 "precision highp float;\n"
502 "attribute vec2 a_position;\n" 502 "attribute vec2 a_position;\n"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 static_cast<float>(dst_size.width()), 805 static_cast<float>(dst_size.width()),
806 static_cast<float>(dst_size.height())); 806 static_cast<float>(dst_size.height()));
807 807
808 context_->uniform2f(scaling_vector_location_, 808 context_->uniform2f(scaling_vector_location_,
809 scale_x ? 1.0 : 0.0, 809 scale_x ? 1.0 : 0.0,
810 scale_x ? 0.0 : 1.0); 810 scale_x ? 0.0 : 1.0);
811 context_->uniform4fv(color_weights_location_, 1, color_weights); 811 context_->uniform4fv(color_weights_location_, 1, color_weights);
812 } 812 }
813 813
814 } // namespace content 814 } // namespace content
OLDNEW
« no previous file with comments | « content/common/child_thread.cc ('k') | content/common/gpu/client/gpu_channel_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698