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

Side by Side Diff: tools/gpu/gpu_tools/texture_upload_benchmark.py

Issue 10916292: Adaptively throttle texture uploads (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add tests. Created 8 years, 3 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
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 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 import os 4 import os
5 5
6 import chrome_remote_control 6 import chrome_remote_control
7 7
8 import multi_page_benchmark 8 import multi_page_benchmark
9 import scrolling_benchmark 9 import scrolling_benchmark
10 10
11 11
12 class TextureUploadBenchmark(scrolling_benchmark.ScrollingBenchmark): 12 class TextureUploadBenchmark(scrolling_benchmark.ScrollingBenchmark):
13 def MeasurePage(self, page, tab): 13 def MeasurePage(self, page, tab):
14 rendering_stats = self.ScrollPageFully(tab) 14 rendering_stats = self.ScrollPageFully(tab)
15
16 if rendering_stats["totalCommitCount"] == 0 :
17 averageCommitTimeMs = 0
18 else :
19 averageCommitTimeMs = (1000 * rendering_stats["totalCommitTimeInSeconds"]
20 / rendering_stats["totalCommitCount"])
21
15 return { 22 return {
16 "texture_upload_count": rendering_stats["textureUploadCount"] 23 "texture_upload_count": rendering_stats["textureUploadCount"],
24 "average_commit_time_ms": averageCommitTimeMs
17 } 25 }
18 26
19 def Main(): 27 def Main():
20 return multi_page_benchmark.Main(TextureUploadBenchmark()) 28 return multi_page_benchmark.Main(TextureUploadBenchmark())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698