| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/scheduler/texture_uploader.h" | 5 #include "cc/scheduler/texture_uploader.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 static const size_t kUploadHistorySizeMax = 1000; | 26 static const size_t kUploadHistorySizeMax = 1000; |
| 27 static const size_t kUploadHistorySizeInitial = 100; | 27 static const size_t kUploadHistorySizeInitial = 100; |
| 28 | 28 |
| 29 // Global estimated number of textures per second to maintain estimates across | 29 // Global estimated number of textures per second to maintain estimates across |
| 30 // subsequent instances of TextureUploader. | 30 // subsequent instances of TextureUploader. |
| 31 // More than one thread will not access this variable, so we do not need to | 31 // More than one thread will not access this variable, so we do not need to |
| 32 // synchronize access. | 32 // synchronize access. |
| 33 static const double kDefaultEstimatedTexturesPerSecond = 48.0 * 60.0; | 33 static const double kDefaultEstimatedTexturesPerSecond = 48.0 * 60.0; |
| 34 | 34 |
| 35 // Flush interval when performing texture uploads. | 35 // Flush interval when performing texture uploads. |
| 36 static const size_t kTextureUploadFlushPeriod = 4; | 36 static const int kTextureUploadFlushPeriod = 4; |
| 37 | 37 |
| 38 } // anonymous namespace | 38 } // anonymous namespace |
| 39 | 39 |
| 40 namespace cc { | 40 namespace cc { |
| 41 | 41 |
| 42 TextureUploader::Query::Query(WebKit::WebGraphicsContext3D* context) | 42 TextureUploader::Query::Query(WebKit::WebGraphicsContext3D* context) |
| 43 : context_(context), | 43 : context_(context), |
| 44 query_id_(0), | 44 query_id_(0), |
| 45 value_(0), | 45 value_(0), |
| 46 has_value_(false), | 46 has_value_(false), |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 textures_per_second_history_.erase(textures_per_second_history_.begin()); | 342 textures_per_second_history_.erase(textures_per_second_history_.begin()); |
| 343 textures_per_second_history_.erase(--textures_per_second_history_.end()); | 343 textures_per_second_history_.erase(--textures_per_second_history_.end()); |
| 344 } | 344 } |
| 345 textures_per_second_history_.insert(textures_per_second); | 345 textures_per_second_history_.insert(textures_per_second); |
| 346 | 346 |
| 347 available_queries_.push_back(pending_queries_.take_front()); | 347 available_queries_.push_back(pending_queries_.take_front()); |
| 348 } | 348 } |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace cc | 351 } // namespace cc |
| OLD | NEW |