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

Unified Diff: Source/platform/graphics/PictureSnapshot.cpp

Issue 1167063002: DevTools: return error when trying to load an empty (0 x 0) picture (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « Source/platform/graphics/PictureSnapshot.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/PictureSnapshot.cpp
diff --git a/Source/platform/graphics/PictureSnapshot.cpp b/Source/platform/graphics/PictureSnapshot.cpp
index 1458af35eb03426a4f5604ed616fd0cde33aa020..4bf892169ea470577f61d0c7440684089508e67d 100644
--- a/Source/platform/graphics/PictureSnapshot.cpp
+++ b/Source/platform/graphics/PictureSnapshot.cpp
@@ -96,6 +96,11 @@ PassRefPtr<PictureSnapshot> PictureSnapshot::load(const Vector<RefPtr<TilePictur
return adoptRef(new PictureSnapshot(adoptRef(recorder.endRecordingAsPicture())));
}
+bool PictureSnapshot::isEmpty() const
+{
+ return m_picture->cullRect().isEmpty();
+}
+
PassOwnPtr<Vector<char>> PictureSnapshot::replay(unsigned fromStep, unsigned toStep, double scale) const
{
const SkIRect bounds = m_picture->cullRect().roundOut();
@@ -133,8 +138,10 @@ PassOwnPtr<PictureSnapshot::Timings> PictureSnapshot::profile(unsigned minRepeat
if (timings->size() > 1)
currentTimings->reserveCapacity(timings->begin()->size());
ProfilingCanvas canvas(bitmap);
- if (clipRect)
+ if (clipRect) {
canvas.clipRect(SkRect::MakeXYWH(clipRect->x(), clipRect->y(), clipRect->width(), clipRect->height()));
+ canvas.resetStepCount();
+ }
canvas.setTimings(currentTimings);
m_picture->playback(&canvas);
now = WTF::monotonicallyIncreasingTime();
« no previous file with comments | « Source/platform/graphics/PictureSnapshot.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698