diff options
author | aelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-11 20:01:35 +0000 |
---|---|---|
committer | aelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-11 20:01:35 +0000 |
commit | 891621bc1754d9fb6a44beea516f0495447f9fbb (patch) | |
tree | 8bab70da30fb088e5ba32922e966e7c1864ccbc6 | |
parent | b17e2df888390f4d60855852d397f41751ff3ec2 (diff) | |
download | chromium_src-891621bc1754d9fb6a44beea516f0495447f9fbb.zip chromium_src-891621bc1754d9fb6a44beea516f0495447f9fbb.tar.gz chromium_src-891621bc1754d9fb6a44beea516f0495447f9fbb.tar.bz2 |
Fix DCHECK in browser software compositing.
I introduced this problem in r205501.
NOTRY=true
BUG=237006
Review URL: https://chromiumcodereview.appspot.com/16781004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205614 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 17 insertions, 16 deletions
diff --git a/cc/output/software_output_device.cc b/cc/output/software_output_device.cc index 30817e0..fc77eb4 100644 --- a/cc/output/software_output_device.cc +++ b/cc/output/software_output_device.cc @@ -33,13 +33,11 @@ SkCanvas* SoftwareOutputDevice::BeginPaint(gfx::Rect damage_rect) { } void SoftwareOutputDevice::EndPaint(SoftwareFrameData* frame_data) { - DCHECK(device_); - if (frame_data) { - frame_data->id = 0; - frame_data->size = viewport_size_; - frame_data->damage_rect = damage_rect_; - frame_data->handle = base::SharedMemory::NULLHandle(); - } + DCHECK(frame_data); + frame_data->id = 0; + frame_data->size = viewport_size_; + frame_data->damage_rect = damage_rect_; + frame_data->handle = base::SharedMemory::NULLHandle(); } void SoftwareOutputDevice::CopyToBitmap( diff --git a/content/browser/renderer_host/software_output_device_win.cc b/content/browser/renderer_host/software_output_device_win.cc index c3af6a2..6535d4d2 100644 --- a/content/browser/renderer_host/software_output_device_win.cc +++ b/content/browser/renderer_host/software_output_device_win.cc @@ -52,11 +52,13 @@ SkCanvas* SoftwareOutputDeviceWin::BeginPaint(gfx::Rect damage_rect) { void SoftwareOutputDeviceWin::EndPaint(cc::SoftwareFrameData* frame_data) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(contents_); - DCHECK(frame_data == NULL); + DCHECK(frame_data); if (!contents_) return; + SoftwareOutputDevice::EndPaint(frame_data); + gfx::Rect rect = damage_rect_; rect.Intersect(gfx::Rect(viewport_size_)); if (rect.IsEmpty()) diff --git a/content/browser/renderer_host/software_output_device_x11.cc b/content/browser/renderer_host/software_output_device_x11.cc index 76c01ab..2c7ab22 100644 --- a/content/browser/renderer_host/software_output_device_x11.cc +++ b/content/browser/renderer_host/software_output_device_x11.cc @@ -65,11 +65,13 @@ void SoftwareOutputDeviceX11::Resize(gfx::Size viewport_size) { void SoftwareOutputDeviceX11::EndPaint(cc::SoftwareFrameData* frame_data) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(device_); - DCHECK(frame_data == NULL); + DCHECK(frame_data); if (!device_) return; + SoftwareOutputDevice::EndPaint(frame_data); + gfx::Rect rect = damage_rect_; rect.Intersect(gfx::Rect(viewport_size_)); if (rect.IsEmpty()) diff --git a/content/renderer/gpu/compositor_software_output_device.cc b/content/renderer/gpu/compositor_software_output_device.cc index 23710ab..21fad4e 100644 --- a/content/renderer/gpu/compositor_software_output_device.cc +++ b/content/renderer/gpu/compositor_software_output_device.cc @@ -179,14 +179,13 @@ SkCanvas* CompositorSoftwareOutputDevice::BeginPaint(gfx::Rect damage_rect) { void CompositorSoftwareOutputDevice::EndPaint( cc::SoftwareFrameData* frame_data) { DCHECK(CalledOnValidThread()); + DCHECK(frame_data); - if (frame_data) { - Buffer* buffer = buffers_[current_index_]; - frame_data->id = buffer->id(); - frame_data->size = viewport_size_; - frame_data->damage_rect = damage_rect_; - frame_data->handle = buffer->handle(); - } + Buffer* buffer = buffers_[current_index_]; + frame_data->id = buffer->id(); + frame_data->size = viewport_size_; + frame_data->damage_rect = damage_rect_; + frame_data->handle = buffer->handle(); } void CompositorSoftwareOutputDevice::ReclaimSoftwareFrame(unsigned id) { |