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

Unified Diff: ui/gl/async_pixel_transfer_delegate_stub.cc

Issue 11659020: gpu: Report time spent performing async texture uploads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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 | « ui/gl/async_pixel_transfer_delegate_stub.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/async_pixel_transfer_delegate_stub.cc
diff --git a/ui/gl/async_pixel_transfer_delegate_stub.cc b/ui/gl/async_pixel_transfer_delegate_stub.cc
index 898a5744f44fcf18c805423773da090672ac415d..86f068735a49c237fb88f23a3cdc8cdffd3a7fe4 100644
--- a/ui/gl/async_pixel_transfer_delegate_stub.cc
+++ b/ui/gl/async_pixel_transfer_delegate_stub.cc
@@ -62,7 +62,8 @@ void AsyncTransferStateStub::BindTransfer(AsyncTexImage2DParams* out_params) {
needs_late_bind_ = false;
}
-AsyncPixelTransferDelegateStub::AsyncPixelTransferDelegateStub() {
+AsyncPixelTransferDelegateStub::AsyncPixelTransferDelegateStub()
+ : texture_upload_count_(0) {
}
AsyncPixelTransferDelegateStub::~AsyncPixelTransferDelegateStub() {
@@ -122,6 +123,7 @@ void AsyncPixelTransferDelegateStub::AsyncTexSubImage2D(
AsyncTransferStateStub* state =
static_cast<AsyncTransferStateStub*>(transfer_state);
DCHECK(!state->needs_late_bind_);
+ base::TimeTicks begin_time(base::TimeTicks::HighResNow());
glTexSubImage2D(
tex_params.target,
tex_params.level,
@@ -132,6 +134,17 @@ void AsyncPixelTransferDelegateStub::AsyncTexSubImage2D(
tex_params.format,
tex_params.type,
data);
+ texture_upload_count_++;
+ total_texture_upload_time_ += base::TimeTicks::HighResNow() - begin_time;
}
+
+uint32 AsyncPixelTransferDelegateStub::GetTextureUploadCount() {
+ return texture_upload_count_;
+}
+
+base::TimeDelta AsyncPixelTransferDelegateStub::GetTotalTextureUploadTime() {
+ return total_texture_upload_time_;
+}
+
} // namespace gfx
« no previous file with comments | « ui/gl/async_pixel_transfer_delegate_stub.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698