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

Side by Side Diff: gpu/command_buffer/service/gpu_tracer_unittest.cc

Issue 924023003: gpu: Initialize GLFakeQueries data members. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" 9 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
10 #include "gpu/command_buffer/service/gpu_service_test.h" 10 #include "gpu/command_buffer/service/gpu_service_test.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 MOCK_METHOD2(TraceServiceEnd, 43 MOCK_METHOD2(TraceServiceEnd,
44 void(const std::string& category, const std::string& name)); 44 void(const std::string& category, const std::string& name));
45 45
46 protected: 46 protected:
47 ~MockOutputter() {} 47 ~MockOutputter() {}
48 }; 48 };
49 49
50 class GlFakeQueries { 50 class GlFakeQueries {
51 public: 51 public:
52 GlFakeQueries() {} 52 GlFakeQueries() : alloced_queries_(), query_timestamp_() {}
Nico 2015/02/13 19:42:51 You don't need this. The default constructors of c
Daniele Castagna 2015/02/13 19:46:44 Done.
53 53
54 void Reset() { 54 void Reset() {
55 current_time_ = 0; 55 current_time_ = 0;
56 next_query_id_ = 23; 56 next_query_id_ = 23;
57 alloced_queries_.clear(); 57 alloced_queries_.clear();
58 query_timestamp_.clear(); 58 query_timestamp_.clear();
59 } 59 }
60 60
61 void SetCurrentGLTime(GLint64 current_time) { current_time_ = current_time; } 61 void SetCurrentGLTime(GLint64 current_time) { current_time_ = current_time; }
62 void SetDisjoint() { disjointed_ = true; } 62 void SetDisjoint() { disjointed_ = true; }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 void Finish() { 136 void Finish() {
137 } 137 }
138 138
139 GLenum GetError() { 139 GLenum GetError() {
140 return GL_NO_ERROR; 140 return GL_NO_ERROR;
141 } 141 }
142 142
143 protected: 143 protected:
144 bool disjointed_; 144 bool disjointed_ = false;
145 GLint64 current_time_; 145 GLint64 current_time_ = 0;
146 GLuint next_query_id_; 146 GLuint next_query_id_ = 0;
147 std::set<GLuint> alloced_queries_; 147 std::set<GLuint> alloced_queries_;
148 std::map<GLuint, GLint64> query_timestamp_; 148 std::map<GLuint, GLint64> query_timestamp_;
149 }; 149 };
150 150
151 class GPUTracerTester : public GPUTracer { 151 class GPUTracerTester : public GPUTracer {
152 public: 152 public:
153 explicit GPUTracerTester(gles2::GLES2Decoder* decoder) 153 explicit GPUTracerTester(gles2::GLES2Decoder* decoder)
154 : GPUTracer(decoder), tracing_enabled_(0) { 154 : GPUTracer(decoder), tracing_enabled_(0) {
155 gpu_timing_.SetCpuTimeForTesting(base::Bind(&FakeCpuTime)); 155 gpu_timing_.SetCpuTimeForTesting(base::Bind(&FakeCpuTime));
156 156
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 639
640 ASSERT_TRUE(tracer_tester_->BeginDecoding()); 640 ASSERT_TRUE(tracer_tester_->BeginDecoding());
641 EXPECT_TRUE( 641 EXPECT_TRUE(
642 tracer_tester_->Begin(category_name, trace_name, kTraceGroupMarker)); 642 tracer_tester_->Begin(category_name, trace_name, kTraceGroupMarker));
643 ASSERT_TRUE(tracer_tester_->EndDecoding()); 643 ASSERT_TRUE(tracer_tester_->EndDecoding());
644 } 644 }
645 645
646 } // namespace 646 } // namespace
647 } // namespace gles2 647 } // namespace gles2
648 } // namespace gpu 648 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698