aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-06-03 10:53:59 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-03 10:54:00 -0700
commit868074b50b0fc3e460d2aa97c1096827fe0a1935 (patch)
treec5ab88df3447648135bda22d667fe93d362d384e /samplecode
parent55ada0630e1ce1bfd6e6e60b70370384530622cc (diff)
remove SkBounder -- unused and unloved
BUG=skia: R=scroggo@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/312553006
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleApp.cpp41
-rw-r--r--samplecode/SampleCode.h6
2 files changed, 2 insertions, 45 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index ad03feacc8..5e304d8661 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -4,6 +4,7 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "SampleApp.h"
#include "SkData.h"
@@ -2270,14 +2271,6 @@ bool SampleView::onEvent(const SkEvent& evt) {
return true;
}
- if (evt.isType("debug-hit-test")) {
- fDebugHitTest = true;
- evt.findS32("debug-hit-test-x", &fDebugHitTestLoc.fX);
- evt.findS32("debug-hit-test-y", &fDebugHitTestLoc.fY);
- this->inval(NULL);
- return true;
- }
-
return this->INHERITED::onEvent(evt);
}
@@ -2385,45 +2378,13 @@ void SampleView::draw(SkCanvas* canvas) {
}
}
-#include "SkBounder.h"
-
-class DebugHitTestBounder : public SkBounder {
-public:
- DebugHitTestBounder(int x, int y) {
- fLoc.set(x, y);
- }
-
- virtual bool onIRect(const SkIRect& bounds) SK_OVERRIDE {
- if (bounds.contains(fLoc.x(), fLoc.y())) {
- //
- // Set a break-point here to see what was being drawn under
- // the click point (just needed a line of code to stop the debugger)
- //
- bounds.centerX();
- }
- return true;
- }
-
-private:
- SkIPoint fLoc;
- typedef SkBounder INHERITED;
-};
-
void SampleView::onDraw(SkCanvas* canvas) {
this->onDrawBackground(canvas);
- DebugHitTestBounder bounder(fDebugHitTestLoc.x(), fDebugHitTestLoc.y());
- if (fDebugHitTest) {
- canvas->setBounder(&bounder);
- }
-
for (int i = 0; i < fRepeatCount; i++) {
SkAutoCanvasRestore acr(canvas, true);
this->onDrawContent(canvas);
}
-
- fDebugHitTest = false;
- canvas->setBounder(NULL);
}
void SampleView::onDrawBackground(SkCanvas* canvas) {
diff --git a/samplecode/SampleCode.h b/samplecode/SampleCode.h
index 7c0452a90a..26a8207ddc 100644
--- a/samplecode/SampleCode.h
+++ b/samplecode/SampleCode.h
@@ -109,8 +109,7 @@ public:
: fPipeState(SkOSMenu::kOffState)
, fBGColor(SK_ColorWHITE)
, fRepeatCount(1)
- , fDebugHitTest(false) {
- }
+ {}
void setBGColor(SkColor color) { fBGColor = color; }
@@ -145,9 +144,6 @@ protected:
private:
int fRepeatCount;
- bool fDebugHitTest;
- SkIPoint fDebugHitTestLoc;
-
typedef SkView INHERITED;
};