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

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

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 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_switches.cc ('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 GPU_COMMAND_BUFFER_SERVICE_GPU_TIMING_H_ 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_TIMING_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_GPU_TIMING_H_ 6 #define GPU_COMMAND_BUFFER_SERVICE_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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 class GPUTiming { 45 class GPUTiming {
46 public: 46 public:
47 enum TimerType { 47 enum TimerType {
48 kTimerTypeInvalid = -1, 48 kTimerTypeInvalid = -1,
49 49
50 kTimerTypeARB, // ARB_timer_query 50 kTimerTypeARB, // ARB_timer_query
51 kTimerTypeDisjoint // EXT_disjoint_timer_query 51 kTimerTypeDisjoint // EXT_disjoint_timer_query
52 }; 52 };
53 53
54 TimerType GetTimerType() const { return timer_type_; } 54 TimerType GetTimerType() const { return timer_type_; }
55 uint32_t GetDisjointCount();
55 56
56 private: 57 private:
57 friend struct base::DefaultDeleter<GPUTiming>; 58 friend struct base::DefaultDeleter<GPUTiming>;
58 friend class GLContextReal; 59 friend class GLContextReal;
59 explicit GPUTiming(GLContextReal* context); 60 explicit GPUTiming(GLContextReal* context);
60 ~GPUTiming(); 61 ~GPUTiming();
61 62
62 scoped_refptr<GPUTimingClient> CreateGPUTimingClient(); 63 scoped_refptr<GPUTimingClient> CreateGPUTimingClient();
63 64
64 TimerType timer_type_ = kTimerTypeInvalid; 65 TimerType timer_type_ = kTimerTypeInvalid;
66 uint32_t disjoint_counter_ = 0;
65 DISALLOW_COPY_AND_ASSIGN(GPUTiming); 67 DISALLOW_COPY_AND_ASSIGN(GPUTiming);
66 }; 68 };
67 69
68 // Class to compute the amount of time it takes to fully 70 // Class to compute the amount of time it takes to fully
69 // complete a set of GL commands 71 // complete a set of GL commands
70 class GL_EXPORT GPUTimer { 72 class GL_EXPORT GPUTimer {
71 public: 73 public:
72 ~GPUTimer(); 74 ~GPUTimer();
73 75
74 void Start(); 76 void Start();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 private: 120 private:
119 friend class base::RefCounted<GPUTimingClient>; 121 friend class base::RefCounted<GPUTimingClient>;
120 friend class GPUTimer; 122 friend class GPUTimer;
121 friend class GPUTiming; 123 friend class GPUTiming;
122 124
123 virtual ~GPUTimingClient(); 125 virtual ~GPUTimingClient();
124 126
125 GPUTiming* gpu_timing_; 127 GPUTiming* gpu_timing_;
126 GPUTiming::TimerType timer_type_ = GPUTiming::kTimerTypeInvalid; 128 GPUTiming::TimerType timer_type_ = GPUTiming::kTimerTypeInvalid;
127 int64 offset_ = 0; // offset cache when timer_type_ == kTimerTypeARB 129 int64 offset_ = 0; // offset cache when timer_type_ == kTimerTypeARB
130 uint32_t disjoint_counter_ = 0;
128 bool offset_valid_ = false; 131 bool offset_valid_ = false;
129 base::Callback<int64(void)> cpu_time_for_testing_; 132 base::Callback<int64(void)> cpu_time_for_testing_;
130 133
131 DISALLOW_COPY_AND_ASSIGN(GPUTimingClient); 134 DISALLOW_COPY_AND_ASSIGN(GPUTimingClient);
132 }; 135 };
133 136
134 } // namespace gfx 137 } // namespace gfx
135 138
136 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_TIMING_H_ 139 #endif // GPU_COMMAND_BUFFER_SERVICE_GPU_TIMING_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_switches.cc ('k') | ui/gl/gpu_timing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698