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

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

Issue 1213193003: Remove DCHECK_IMPLIES and CHECK_IMPLIES (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 "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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 texture_location_ = gl_->GetUniformLocation(program_, "s_texture"); 863 texture_location_ = gl_->GetUniformLocation(program_, "s_texture");
864 src_subrect_location_ = gl_->GetUniformLocation(program_, "src_subrect"); 864 src_subrect_location_ = gl_->GetUniformLocation(program_, "src_subrect");
865 src_pixelsize_location_ = gl_->GetUniformLocation(program_, "src_pixelsize"); 865 src_pixelsize_location_ = gl_->GetUniformLocation(program_, "src_pixelsize");
866 dst_pixelsize_location_ = gl_->GetUniformLocation(program_, "dst_pixelsize"); 866 dst_pixelsize_location_ = gl_->GetUniformLocation(program_, "dst_pixelsize");
867 scaling_vector_location_ = 867 scaling_vector_location_ =
868 gl_->GetUniformLocation(program_, "scaling_vector"); 868 gl_->GetUniformLocation(program_, "scaling_vector");
869 color_weights_location_ = gl_->GetUniformLocation(program_, "color_weights"); 869 color_weights_location_ = gl_->GetUniformLocation(program_, "color_weights");
870 // The only reason fetching these attribute locations should fail is 870 // The only reason fetching these attribute locations should fail is
871 // if the context was spontaneously lost (i.e., because the GPU 871 // if the context was spontaneously lost (i.e., because the GPU
872 // process crashed, perhaps deliberately for testing). 872 // process crashed, perhaps deliberately for testing).
873 DCHECK_IMPLIES(!Initialized(), 873 DCHECK(Initialized() || gl_->GetGraphicsResetStatusKHR() != GL_NO_ERROR);
874 gl_->GetGraphicsResetStatusKHR() != GL_NO_ERROR);
875 } 874 }
876 875
877 void ShaderProgram::UseProgram(const gfx::Size& src_size, 876 void ShaderProgram::UseProgram(const gfx::Size& src_size,
878 const gfx::Rect& src_subrect, 877 const gfx::Rect& src_subrect,
879 const gfx::Size& dst_size, 878 const gfx::Size& dst_size,
880 bool scale_x, 879 bool scale_x,
881 bool flip_y, 880 bool flip_y,
882 GLfloat color_weights[4]) { 881 GLfloat color_weights[4]) {
883 gl_->UseProgram(program_); 882 gl_->UseProgram(program_);
884 883
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 gl_->Uniform2f(dst_pixelsize_location_, 922 gl_->Uniform2f(dst_pixelsize_location_,
924 static_cast<float>(dst_size.width()), 923 static_cast<float>(dst_size.width()),
925 static_cast<float>(dst_size.height())); 924 static_cast<float>(dst_size.height()));
926 925
927 gl_->Uniform2f( 926 gl_->Uniform2f(
928 scaling_vector_location_, scale_x ? 1.0 : 0.0, scale_x ? 0.0 : 1.0); 927 scaling_vector_location_, scale_x ? 1.0 : 0.0, scale_x ? 0.0 : 1.0);
929 gl_->Uniform4fv(color_weights_location_, 1, color_weights); 928 gl_->Uniform4fv(color_weights_location_, 1, color_weights);
930 } 929 }
931 930
932 } // namespace content 931 } // namespace content
OLDNEW
« no previous file with comments | « content/common/discardable_shared_memory_heap.cc ('k') | content/renderer/gpu/mailbox_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698