| Index: samplecode/SampleApp.cpp
|
| diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
|
| index ad03feacc8d5803cbd96bf19434565df1a9f77ee..5e304d86611824ab7d13b79ef3e797672df46485 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) {
|
|
|