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

Unified Diff: cc/ring_buffer.h

Issue 12209022: cc: add rasterize time to continuous painting graph data in impl-side-painting (Closed) Base URL: http://git.chromium.org/chromium/src.git@raster
Patch Set: Fixed style Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/rendering_stats.cc ('k') | cc/tile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/ring_buffer.h
diff --git a/cc/ring_buffer.h b/cc/ring_buffer.h
index 929d74cb0e91e2d28e861c77a8bce375eea8794d..5e015fe3f8604bf48283c622f3e781afd6ce73f4 100644
--- a/cc/ring_buffer.h
+++ b/cc/ring_buffer.h
@@ -36,11 +36,20 @@ class RingBuffer {
return buffer_[BufferIndex(n)];
}
- void SaveToBuffer(T value) {
+ T& MutableReadBuffer(size_t n) {
+ DCHECK(IsFilledIndex(n));
+ return buffer_[BufferIndex(n)];
+ }
+
+ void SaveToBuffer(const T& value) {
buffer_[BufferIndex(0)] = value;
current_index_++;
}
+ void Clear() {
+ current_index_ = 0;
+ }
+
private:
inline size_t BufferIndex(size_t n) const {
return (current_index_ + n) % size;
« no previous file with comments | « cc/rendering_stats.cc ('k') | cc/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698