aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-01-23 11:39:45 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-23 17:14:53 +0000
commit918e144408ba218df919528f8b48c544f4767883 (patch)
treeaf398e3c3a1f779024a0d60d6db43aadb58e29ac /bench
parent9adfef8680c22ce8980031b4bcb9f1fadd066a80 (diff)
change clip-bounds getters to always return the rect
(actually fixes undefined result in getClipBounds) future CLs - update all callers to new apis - move/rename virtuals BUG=skia: DOCS_PREVIEW= https://skia.org/?cl=7400 Change-Id: I45b93014e915c0d1c36d97d948c9ac8931f23258 Reviewed-on: https://skia-review.googlesource.com/7400 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'bench')
-rw-r--r--bench/ChromeBench.cpp5
-rw-r--r--bench/SKPAnimationBench.cpp3
-rw-r--r--bench/SKPBench.cpp4
3 files changed, 7 insertions, 5 deletions
diff --git a/bench/ChromeBench.cpp b/bench/ChromeBench.cpp
index 94c3f2587c..60d86f9a42 100644
--- a/bench/ChromeBench.cpp
+++ b/bench/ChromeBench.cpp
@@ -480,10 +480,11 @@ protected:
SkIntToScalar(gmailScrollingRectSpec[i*3+1]), SkIntToScalar(gmailScrollingRectSpec[i*3+2]));
}
void validateBounds(SkCanvas* canvas) {
- SkIRect bounds;
- canvas->getClipDeviceBounds(&bounds);
+#ifdef SK_DEBUG
+ SkIRect bounds = canvas->getDeviceClipBounds();
SkASSERT(bounds.right()-bounds.left() >= W);
SkASSERT(bounds.bottom()-bounds.top() >= H);
+#endif
}
diff --git a/bench/SKPAnimationBench.cpp b/bench/SKPAnimationBench.cpp
index 1a1ca447e5..9aa7ba3ccf 100644
--- a/bench/SKPAnimationBench.cpp
+++ b/bench/SKPAnimationBench.cpp
@@ -23,7 +23,8 @@ const char* SKPAnimationBench::onGetUniqueName() {
void SKPAnimationBench::onPerCanvasPreDraw(SkCanvas* canvas) {
INHERITED::onPerCanvasPreDraw(canvas);
- SkAssertResult(canvas->getClipDeviceBounds(&fDevBounds));
+ fDevBounds = canvas->getDeviceClipBounds();
+ SkAssertResult(!fDevBounds.isEmpty());
fAnimationTimer.start();
}
diff --git a/bench/SKPBench.cpp b/bench/SKPBench.cpp
index 9d4dcc5b1a..013ec53cda 100644
--- a/bench/SKPBench.cpp
+++ b/bench/SKPBench.cpp
@@ -50,8 +50,8 @@ const char* SKPBench::onGetUniqueName() {
}
void SKPBench::onPerCanvasPreDraw(SkCanvas* canvas) {
- SkIRect bounds;
- SkAssertResult(canvas->getClipDeviceBounds(&bounds));
+ SkIRect bounds = canvas->getDeviceClipBounds();
+ SkAssertResult(!bounds.isEmpty());
const bool gpu = canvas->getGrContext() != nullptr;
int tileW = gpu ? FLAGS_GPUbenchTileW : FLAGS_CPUbenchTileW,