From 3dc8f1b1cfb7c919d78a2325d72571176c2096b9 Mon Sep 17 00:00:00 2001 From: "fischman@chromium.org" Date: Mon, 21 May 2012 22:54:32 +0000 Subject: Fix crash in UMA reporting of accelerated compositing in WebGL codepaths. BUG=129030 TEST=fast/canvas/webgl/ layouttests all pass Review URL: https://chromiumcodereview.appspot.com/10332275 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138160 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/media/webmediaplayer_impl.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'webkit/media/webmediaplayer_impl.cc') diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc index 2fabfd6..657d9ff 100644 --- a/webkit/media/webmediaplayer_impl.cc +++ b/webkit/media/webmediaplayer_impl.cc @@ -503,8 +503,12 @@ void WebMediaPlayerImpl::paint(WebCanvas* canvas, if (!accelerated_compositing_reported_) { accelerated_compositing_reported_ = true; - DCHECK_EQ(frame_->view()->isAcceleratedCompositingActive(), false); - UMA_HISTOGRAM_BOOLEAN("Media.AcceleratedCompositingActive", false); + // Normally paint() is only called in non-accelerated rendering, but there + // are exceptions such as webgl where compositing is used in the WebView but + // video frames are still rendered to a canvas. + UMA_HISTOGRAM_BOOLEAN( + "Media.AcceleratedCompositingActive", + frame_->view()->isAcceleratedCompositingActive()); } proxy_->Paint(canvas, rect, alpha); @@ -569,7 +573,7 @@ void WebMediaPlayerImpl::putCurrentFrame( WebKit::WebVideoFrame* web_video_frame) { if (!accelerated_compositing_reported_) { accelerated_compositing_reported_ = true; - DCHECK_EQ(frame_->view()->isAcceleratedCompositingActive(), true); + DCHECK(frame_->view()->isAcceleratedCompositingActive()); UMA_HISTOGRAM_BOOLEAN("Media.AcceleratedCompositingActive", true); } if (web_video_frame) { -- cgit v1.1