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

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

Issue 1859703002: convert //gpu to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 4 years, 8 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 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 <vector> 10 #include <vector>
10 11
11 #include "base/containers/small_map.h" 12 #include "base/containers/small_map.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
13 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/strings/stringprintf.h" 15 #include "base/strings/stringprintf.h"
16 #include "gpu/perftests/measurements.h" 16 #include "gpu/perftests/measurements.h"
17 #include "testing/gmock/include/gmock/gmock.h" 17 #include "testing/gmock/include/gmock/gmock.h"
18 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
19 #include "testing/perf/perf_test.h" 19 #include "testing/perf/perf_test.h"
20 #include "ui/gfx/geometry/size.h" 20 #include "ui/gfx/geometry/size.h"
21 #include "ui/gfx/geometry/vector2d_f.h" 21 #include "ui/gfx/geometry/vector2d_f.h"
22 #include "ui/gl/gl_bindings.h" 22 #include "ui/gl/gl_bindings.h"
23 #include "ui/gl/gl_context.h" 23 #include "ui/gl/gl_context.h"
24 #include "ui/gl/gl_enums.h" 24 #include "ui/gl/gl_enums.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 CHECK_NE(0u, shader); 77 CHECK_NE(0u, shader);
78 glShaderSource(shader, 1, &src, NULL); 78 glShaderSource(shader, 1, &src, NULL);
79 glCompileShader(shader); 79 glCompileShader(shader);
80 80
81 GLint compiled = 0; 81 GLint compiled = 0;
82 glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); 82 glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
83 if (compiled == 0) { 83 if (compiled == 0) {
84 GLint len = 0; 84 GLint len = 0;
85 glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len); 85 glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len);
86 if (len > 1) { 86 if (len > 1) {
87 scoped_ptr<char[]> error_log(new char[len]); 87 std::unique_ptr<char[]> error_log(new char[len]);
88 glGetShaderInfoLog(shader, len, NULL, error_log.get()); 88 glGetShaderInfoLog(shader, len, NULL, error_log.get());
89 LOG(ERROR) << "Error compiling shader: " << error_log.get(); 89 LOG(ERROR) << "Error compiling shader: " << error_log.get();
90 } 90 }
91 } 91 }
92 CHECK_NE(0, compiled); 92 CHECK_NE(0, compiled);
93 return shader; 93 return shader;
94 } 94 }
95 95
96 int GLFormatBytePerPixel(GLenum format) { 96 int GLFormatBytePerPixel(GLenum format) {
97 DCHECK(format == GL_RGBA || format == GL_LUMINANCE || format == GL_RED_EXT); 97 DCHECK(format == GL_RGBA || format == GL_LUMINANCE || format == GL_RED_EXT);
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 gpu_timing_client_->CheckAndResetTimerErrors(); 550 gpu_timing_client_->CheckAndResetTimerErrors();
551 if (!gpu_timer_errors) { 551 if (!gpu_timer_errors) {
552 upload_and_draw_timers.GetAsMeasurement("upload_and_draw") 552 upload_and_draw_timers.GetAsMeasurement("upload_and_draw")
553 .PrintResult("renaming"); 553 .PrintResult("renaming");
554 finish_timers.GetAsMeasurement("finish").PrintResult("renaming"); 554 finish_timers.GetAsMeasurement("finish").PrintResult("renaming");
555 } 555 }
556 } 556 }
557 557
558 } // namespace 558 } // namespace
559 } // namespace gpu 559 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/perftests/measurements.h ('k') | gpu/tools/compositor_model_bench/compositor_model_bench.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698