summaryrefslogtreecommitdiffstats
path: root/content/renderer/skia_benchmarking_extension.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/renderer/skia_benchmarking_extension.cc')
-rw-r--r--content/renderer/skia_benchmarking_extension.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/content/renderer/skia_benchmarking_extension.cc b/content/renderer/skia_benchmarking_extension.cc
index 3890e98..42ae3b4 100644
--- a/content/renderer/skia_benchmarking_extension.cc
+++ b/content/renderer/skia_benchmarking_extension.cc
@@ -195,10 +195,12 @@ class SkiaBenchmarkingWrapper : public v8::Extension {
// Raster the requested command subset into the bitmap-backed canvas.
int last_index = debug_canvas.getSize() - 1;
- debug_canvas.setOverdrawViz(overdraw);
- debug_canvas.drawTo(&canvas, stop_index < 0
- ? last_index
- : std::min(last_index, stop_index));
+ if (last_index >= 0) {
+ debug_canvas.setOverdrawViz(overdraw);
+ debug_canvas.drawTo(&canvas, stop_index < 0
+ ? last_index
+ : std::min(last_index, stop_index));
+ }
WebKit::WebArrayBuffer buffer =
WebKit::WebArrayBuffer::create(bitmap.getSize(), 1);