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

Side by Side Diff: ui/gl/gpu_timing.h

Issue 1162203006: Unit tests have been created for the GPUTiming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted egl unit test changes, wrong cl Created 5 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
« no previous file with comments | « ui/gl/gl_tests.gyp ('k') | ui/gl/gpu_timing.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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef UI_GL_GPU_TIMING_H_ 5 #ifndef UI_GL_GPU_TIMING_H_
6 #define UI_GL_GPU_TIMING_H_ 6 #define UI_GL_GPU_TIMING_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/gl/gl_export.h" 10 #include "ui/gl/gl_export.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 // CheckAndResetTimerErrors has to be called before reading timestamps 124 // CheckAndResetTimerErrors has to be called before reading timestamps
125 // from GPUTimers instances and after making sure all the timers 125 // from GPUTimers instances and after making sure all the timers
126 // were available. 126 // were available.
127 // If the returned value is false, all the previous timers should be 127 // If the returned value is false, all the previous timers should be
128 // discarded. 128 // discarded.
129 bool CheckAndResetTimerErrors(); 129 bool CheckAndResetTimerErrors();
130 void InvalidateTimerOffset(); 130 void InvalidateTimerOffset();
131 131
132 void SetCpuTimeForTesting(const base::Callback<int64(void)>& cpu_time); 132 void SetCpuTimeForTesting(const base::Callback<int64(void)>& cpu_time);
133 int64 GetCurrentCPUTime();
133 134
134 private: 135 private:
135 friend class base::RefCounted<GPUTimingClient>; 136 friend class base::RefCounted<GPUTimingClient>;
136 friend class GPUTimer; 137 friend class GPUTimer;
137 friend class GPUTiming; 138 friend class GPUTiming;
138 139
139 virtual ~GPUTimingClient(); 140 virtual ~GPUTimingClient();
140 141
141 // Returns the offset between the current gpu time and the cpu time. 142 // Returns the offset between the current gpu time and the cpu time.
142 int64 CalculateTimerOffset(); 143 int64 CalculateTimerOffset();
143 144
144 GPUTiming* gpu_timing_; 145 GPUTiming* gpu_timing_;
145 GPUTiming::TimerType timer_type_ = GPUTiming::kTimerTypeInvalid; 146 GPUTiming::TimerType timer_type_ = GPUTiming::kTimerTypeInvalid;
146 uint32_t disjoint_counter_ = 0; 147 uint32_t disjoint_counter_ = 0;
147 base::Callback<int64(void)> cpu_time_for_testing_; 148 base::Callback<int64(void)> cpu_time_for_testing_;
148 149
149 DISALLOW_COPY_AND_ASSIGN(GPUTimingClient); 150 DISALLOW_COPY_AND_ASSIGN(GPUTimingClient);
150 }; 151 };
151 152
152 } // namespace gfx 153 } // namespace gfx
153 154
154 #endif // UI_GL_GPU_TIMING_H_ 155 #endif // UI_GL_GPU_TIMING_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_tests.gyp ('k') | ui/gl/gpu_timing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698