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

Side by Side Diff: gpu/perftests/texture_upload_perftest.cc

Issue 2170293002: Use GLVersionInfo instead of gl::GetGLImplementation() to decide GL paths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 4 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
« no previous file with comments | « gpu/command_buffer/service/test_helper.cc ('k') | ui/gl/gl_context_cgl.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 if (gpu_timing_client_->IsAvailable()) { 215 if (gpu_timing_client_->IsAvailable()) {
216 LOG(INFO) << "Gpu timing initialized with timer type: " 216 LOG(INFO) << "Gpu timing initialized with timer type: "
217 << gpu_timing_client_->GetTimerTypeName(); 217 << gpu_timing_client_->GetTimerTypeName();
218 } else { 218 } else {
219 LOG(WARNING) << "Can't initialize gpu timing"; 219 LOG(WARNING) << "Can't initialize gpu timing";
220 } 220 }
221 // Prepare a simple program and a vertex buffer that will be 221 // Prepare a simple program and a vertex buffer that will be
222 // used to draw a quad on the offscreen surface. 222 // used to draw a quad on the offscreen surface.
223 vertex_shader_ = LoadShader(GL_VERTEX_SHADER, kVertexShader); 223 vertex_shader_ = LoadShader(GL_VERTEX_SHADER, kVertexShader);
224 224
225 bool is_gles = gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2; 225 bool is_gles = gl_context_->GetVersionInfo()->is_es;
226 fragment_shader_ = LoadShader( 226 fragment_shader_ = LoadShader(
227 GL_FRAGMENT_SHADER, 227 GL_FRAGMENT_SHADER,
228 base::StringPrintf("%s%s", is_gles ? kShaderDefaultFloatPrecision : "", 228 base::StringPrintf("%s%s", is_gles ? kShaderDefaultFloatPrecision : "",
229 kFragmentShader).c_str()); 229 kFragmentShader).c_str());
230 program_object_ = glCreateProgram(); 230 program_object_ = glCreateProgram();
231 CHECK_NE(0u, program_object_); 231 CHECK_NE(0u, program_object_);
232 232
233 glAttachShader(program_object_, vertex_shader_); 233 glAttachShader(program_object_, vertex_shader_);
234 glAttachShader(program_object_, fragment_shader_); 234 glAttachShader(program_object_, fragment_shader_);
235 glBindAttribLocation(program_object_, 0, "a_position"); 235 glBindAttribLocation(program_object_, 0, "a_position");
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 gpu_timing_client_->CheckAndResetTimerErrors(); 551 gpu_timing_client_->CheckAndResetTimerErrors();
552 if (!gpu_timer_errors) { 552 if (!gpu_timer_errors) {
553 upload_and_draw_timers.GetAsMeasurement("upload_and_draw") 553 upload_and_draw_timers.GetAsMeasurement("upload_and_draw")
554 .PrintResult("renaming"); 554 .PrintResult("renaming");
555 finish_timers.GetAsMeasurement("finish").PrintResult("renaming"); 555 finish_timers.GetAsMeasurement("finish").PrintResult("renaming");
556 } 556 }
557 } 557 }
558 558
559 } // namespace 559 } // namespace
560 } // namespace gpu 560 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/test_helper.cc ('k') | ui/gl/gl_context_cgl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698