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

Unified Diff: src/core/SkTileGrid.cpp

Issue 508873004: Revert of Convert BBH APIs to use SkRect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkTileGrid.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTileGrid.cpp
diff --git a/src/core/SkTileGrid.cpp b/src/core/SkTileGrid.cpp
index 84dc949b36727fe4ac0b9fb74c56dbf2115f0c4a..17102f50e2f75929f9e63cc71f8c55e33a5c0de1 100644
--- a/src/core/SkTileGrid.cpp
+++ b/src/core/SkTileGrid.cpp
@@ -23,15 +23,13 @@
SkDELETE_ARRAY(fTiles);
}
-void SkTileGrid::insert(void* data, const SkRect& fbounds, bool) {
- SkASSERT(!fbounds.isEmpty());
- SkIRect dilatedBounds;
- if (fbounds.isLargest()) {
- // Dilating the largest SkIRect will overflow. Other nearly-largest rects may overflow too,
- // but we don't make active use of them like we do the largest.
- dilatedBounds.setLargest();
- } else {
- fbounds.roundOut(&dilatedBounds);
+void SkTileGrid::insert(void* data, const SkIRect& bounds, bool) {
+ SkASSERT(!bounds.isEmpty());
+ SkIRect dilatedBounds = bounds;
+
+ // Dilating the largest SkIRect will overflow. Other nearly-largest rects may overflow too,
+ // but we don't make active use of them like we do the largest.
+ if (!bounds.isLargest()) {
dilatedBounds.outset(fInfo.fMargin.width(), fInfo.fMargin.height());
dilatedBounds.offset(fInfo.fOffset);
}
@@ -69,9 +67,8 @@
// require 512 tiles of size 256 x 256 pixels.
static const int kStackAllocationTileCount = 1024;
-void SkTileGrid::search(const SkRect& query, SkTDArray<void*>* results) const {
- SkIRect adjusted;
- query.roundOut(&adjusted);
+void SkTileGrid::search(const SkIRect& query, SkTDArray<void*>* results) const {
+ SkIRect adjusted = query;
// The inset is to counteract the outset that was applied in 'insert'
// The outset/inset is to optimize for lookups of size
« no previous file with comments | « src/core/SkTileGrid.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698