OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkView.h" | 8 #include "SkView.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 | 10 |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 matrix->preConcat(view->getLocalMatrix()); | 630 matrix->preConcat(view->getLocalMatrix()); |
631 matrix->preTranslate(-view->fLoc.fX, -view->fLoc.fY); | 631 matrix->preTranslate(-view->fLoc.fX, -view->fLoc.fY); |
632 view = view->fParent; | 632 view = view->fParent; |
633 } | 633 } |
634 } | 634 } |
635 } | 635 } |
636 bool SkView::globalToLocal(SkScalar x, SkScalar y, SkPoint* local) const | 636 bool SkView::globalToLocal(SkScalar x, SkScalar y, SkPoint* local) const |
637 { | 637 { |
638 SkASSERT(this); | 638 SkASSERT(this); |
639 | 639 |
640 if (NULL != local) { | 640 if (local) { |
641 SkMatrix m; | 641 SkMatrix m; |
642 this->localToGlobal(&m); | 642 this->localToGlobal(&m); |
643 if (!m.invert(&m)) { | 643 if (!m.invert(&m)) { |
644 return false; | 644 return false; |
645 } | 645 } |
646 SkPoint p; | 646 SkPoint p; |
647 m.mapXY(x, y, &p); | 647 m.mapXY(x, y, &p); |
648 local->set(p.fX, p.fY); | 648 local->set(p.fX, p.fY); |
649 } | 649 } |
650 | 650 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 SkDebugf(" />\n"); | 834 SkDebugf(" />\n"); |
835 } | 835 } |
836 } | 836 } |
837 | 837 |
838 void SkView::dump(bool recurse) const | 838 void SkView::dump(bool recurse) const |
839 { | 839 { |
840 dumpview(this, 0, recurse); | 840 dumpview(this, 0, recurse); |
841 } | 841 } |
842 | 842 |
843 #endif | 843 #endif |
OLD | NEW |