diff options
author | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 16:40:48 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 16:40:48 +0000 |
commit | 075d1e4d520658e80e674aba03addb06bba1603d (patch) | |
tree | b6259bacf8f331cb949aa233868024b275721923 | |
parent | 4c6dbb216372c8696a99d64358e2b8aff05bf024 (diff) | |
download | chromium_src-075d1e4d520658e80e674aba03addb06bba1603d.zip chromium_src-075d1e4d520658e80e674aba03addb06bba1603d.tar.gz chromium_src-075d1e4d520658e80e674aba03addb06bba1603d.tar.bz2 |
don't call (deprecated) getTotalClip
This will allow us to delete the code behind SK_SUPPORT_LEGACY_GETTOTALCLIP
Review URL: https://codereview.chromium.org/228723006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262707 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | media/filters/skcanvas_video_renderer.cc | 5 | ||||
-rw-r--r-- | ui/gfx/blit.cc | 21 |
2 files changed, 18 insertions, 8 deletions
diff --git a/media/filters/skcanvas_video_renderer.cc b/media/filters/skcanvas_video_renderer.cc index 7b1ba81..90f872b 100644 --- a/media/filters/skcanvas_video_renderer.cc +++ b/media/filters/skcanvas_video_renderer.cc @@ -106,7 +106,10 @@ static void FastPaint( // No point painting if the destination rect doesn't intersect with the // clip rect. - if (!local_dest_irect.intersect(canvas->getTotalClip().getBounds())) + SkIRect device_bounds; + if (!canvas->getClipDeviceBounds(&device_bounds)) + return; + if (!local_dest_irect.intersect(device_bounds)) return; // At this point |local_dest_irect| contains the rect that we should draw diff --git a/ui/gfx/blit.cc b/ui/gfx/blit.cc index 4b87bc9..653c56b 100644 --- a/ui/gfx/blit.cc +++ b/ui/gfx/blit.cc @@ -29,21 +29,28 @@ namespace { // Returns true if the given canvas has any part of itself clipped out or // any non-identity tranform. -bool HasClipOrTransform(const SkCanvas& canvas) { +bool HasClipOrTransform(SkCanvas& canvas) { if (!canvas.getTotalMatrix().isIdentity()) return true; - const SkRegion& clip_region = canvas.getTotalClip(); - if (clip_region.isEmpty() || clip_region.isComplex()) + if (!canvas.isClipRect()) return true; // Now we know the clip is a regular rectangle, make sure it covers the // entire canvas. - const SkBitmap& bitmap = skia::GetTopDevice(canvas)->accessBitmap(false); - const SkIRect& clip_bounds = clip_region.getBounds(); + SkIRect clip_bounds; + canvas.getClipDeviceBounds(&clip_bounds); + + SkImageInfo info; + size_t row_bytes; + void* pixels = canvas.accessTopLayerPixels(&info, &row_bytes); + DCHECK(pixels); + if (!pixels) + return true; + if (clip_bounds.fLeft != 0 || clip_bounds.fTop != 0 || - clip_bounds.fRight != bitmap.width() || - clip_bounds.fBottom != bitmap.height()) + clip_bounds.fRight != info.width() || + clip_bounds.fBottom != info.height()) return true; return false; |