Index: content/browser/renderer_host/render_widget_host_view_android.cc |
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc |
index 6a9a341b24d9552fb9ec5d7c0893f7428d193015..d85bc3fef3ff7b0eab6917b421583dc2bcf71895 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_android.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
@@ -12,6 +12,7 @@ |
#include "base/command_line.h" |
#include "base/logging.h" |
#include "base/message_loop/message_loop.h" |
+#include "base/metrics/histogram.h" |
#include "base/strings/utf_string_conversions.h" |
#include "base/threading/worker_pool.h" |
#include "cc/base/latency_info_swap_promise.h" |
@@ -90,10 +91,13 @@ void CopyFromCompositingSurfaceFinished( |
const base::Callback<void(bool, const SkBitmap&)>& callback, |
scoped_ptr<cc::SingleReleaseCallback> release_callback, |
scoped_ptr<SkBitmap> bitmap, |
+ const base::TimeTicks& start_time, |
scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock, |
bool result) { |
bitmap_pixels_lock.reset(); |
release_callback->Run(0, false); |
+ UMA_HISTOGRAM_TIMES("RWHVA.CopyFromCompositingSurface asyncreadback time", |
jar (doing other things)
2014/01/11 03:41:39
nit: Did you intend to add data to the same histog
sivag
2014/01/14 13:38:22
Done.
|
+ base::TimeTicks::Now() - start_time); |
callback.Run(result, *bitmap); |
} |
@@ -585,6 +589,7 @@ void RenderWidgetHostViewAndroid::CopyFromCompositingSurface( |
const gfx::Rect& src_subrect, |
const gfx::Size& dst_size, |
const base::Callback<void(bool, const SkBitmap&)>& callback) { |
+ base::TimeTicks start_time = base::TimeTicks::Now(); |
if (!using_synchronous_compositor_ && !IsSurfaceAvailableForCopy()) { |
callback.Run(false, SkBitmap()); |
return; |
@@ -603,6 +608,8 @@ void RenderWidgetHostViewAndroid::CopyFromCompositingSurface( |
if (using_synchronous_compositor_) { |
SynchronousCopyContents(src_subrect_in_pixel, dst_size_in_pixel, callback); |
+ UMA_HISTOGRAM_TIMES("RWHVA.SynchronousCopyContents", |
+ base::TimeTicks::Now() - start_time); |
return; |
} |
@@ -611,15 +618,18 @@ void RenderWidgetHostViewAndroid::CopyFromCompositingSurface( |
request = cc::CopyOutputRequest::CreateBitmapRequest(base::Bind( |
&RenderWidgetHostViewAndroid::PrepareBitmapCopyOutputResult, |
dst_size_in_pixel, |
+ start_time, |
callback)); |
} else { |
request = cc::CopyOutputRequest::CreateRequest(base::Bind( |
&RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult, |
dst_size_in_pixel, |
+ start_time, |
callback)); |
} |
request->set_area(src_subrect_in_pixel); |
layer_->RequestCopyOfOutput(request.Pass()); |
+ |
jar (doing other things)
2014/01/11 03:41:39
nit: no need for blank line
sivag
2014/01/14 13:38:22
Done.
|
} |
void RenderWidgetHostViewAndroid::CopyFromCompositingSurfaceToVideoFrame( |
@@ -1315,6 +1325,7 @@ void RenderWidgetHostViewAndroid::OnLostResources() { |
// static |
void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult( |
const gfx::Size& dst_size_in_pixel, |
+ const base::TimeTicks& start_time, |
const base::Callback<void(bool, const SkBitmap&)>& callback, |
scoped_ptr<cc::CopyOutputResult> result) { |
DCHECK(result->HasTexture()); |
@@ -1361,12 +1372,14 @@ void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult( |
callback, |
base::Passed(&release_callback), |
base::Passed(&bitmap), |
+ start_time, |
base::Passed(&bitmap_pixels_lock))); |
} |
// static |
void RenderWidgetHostViewAndroid::PrepareBitmapCopyOutputResult( |
const gfx::Size& dst_size_in_pixel, |
+ const base::TimeTicks& start_time, |
const base::Callback<void(bool, const SkBitmap&)>& callback, |
scoped_ptr<cc::CopyOutputResult> result) { |
DCHECK(result->HasBitmap()); |
@@ -1385,6 +1398,9 @@ void RenderWidgetHostViewAndroid::PrepareBitmapCopyOutputResult( |
DCHECK_EQ(source->height(), dst_size_in_pixel.height()); |
ignore_result(scoped_callback_runner.Release()); |
+ UMA_HISTOGRAM_TIMES("RWHVA.CopyFromCompositingSurface asyncreadback time", |
+ base::TimeTicks::Now() - start_time); |
+ |
callback.Run(true, *source); |
} |