Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: src/core/SkRTree.cpp

Issue 511613002: Convert BBH APIs to use SkRect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: another in BBH test Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRTree.h ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRTree.cpp
diff --git a/src/core/SkRTree.cpp b/src/core/SkRTree.cpp
index 3985fb12859280f187774764df704ba1d0d51e07..77f94e2eed68fe1cdd622158ce1a9b80390d17ee 100644
--- a/src/core/SkRTree.cpp
+++ b/src/core/SkRTree.cpp
@@ -44,7 +44,14 @@ SkRTree::~SkRTree() {
this->clear();
}
-void SkRTree::insert(void* data, const SkIRect& bounds, bool defer) {
+void SkRTree::insert(void* data, const SkRect& fbounds, bool defer) {
+ SkIRect bounds;
+ if (fbounds.isLargest()) {
+ bounds.setLargest();
+ } else {
+ fbounds.roundOut(&bounds);
+ }
+
this->validate();
if (bounds.isEmpty()) {
SkASSERT(false);
@@ -102,7 +109,9 @@ void SkRTree::flushDeferredInserts() {
this->validate();
}
-void SkRTree::search(const SkIRect& query, SkTDArray<void*>* results) const {
+void SkRTree::search(const SkRect& fquery, SkTDArray<void*>* results) const {
+ SkIRect query;
+ fquery.roundOut(&query);
this->validate();
SkASSERT(0 == fDeferredInserts.count()); // If this fails, you should have flushed.
if (!this->isEmpty() && SkIRect::IntersectsNoEmptyCheck(fRoot.fBounds, query)) {
« no previous file with comments | « src/core/SkRTree.h ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698