aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-11-16 14:52:01 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-11-16 14:52:01 +0000
commite72fee513a5f903d6aa17066d2f3b79ac31f05de (patch)
tree486b749a7e46e13cc5f087b75b7d073b05fd5bdf /src/core
parentf0f4e9abba62a405b7a41e40fcee20b45eb348ee (diff)
add onSendClickToChildren to views, so a view can capture all clicks.
speedup some of the unittests that were too slow minor cleanup in SkScan_Path, in prep for larger changes git-svn-id: http://skia.googlecode.com/svn/trunk@426 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkScan_Path.cpp72
1 files changed, 35 insertions, 37 deletions
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp
index 8246376a79..6d052258bb 100644
--- a/src/core/SkScan_Path.cpp
+++ b/src/core/SkScan_Path.cpp
@@ -369,43 +369,6 @@ static int build_edges(SkEdge edge[], const SkPath& path,
return (int)(list - start);
}
-extern "C" {
- static int edge_compare(const void* a, const void* b)
- {
- const SkEdge* edgea = *(const SkEdge**)a;
- const SkEdge* edgeb = *(const SkEdge**)b;
-
- int valuea = edgea->fFirstY;
- int valueb = edgeb->fFirstY;
-
- if (valuea == valueb)
- {
- valuea = edgea->fX;
- valueb = edgeb->fX;
- }
-
- // this overflows if valuea >>> valueb or vice-versa
- // return valuea - valueb;
- // do perform the slower but safe compares
- return (valuea < valueb) ? -1 : (valuea > valueb);
- }
-}
-
-static SkEdge* sort_edges(SkEdge* list[], int count, SkEdge** last)
-{
- qsort(list, count, sizeof(SkEdge*), edge_compare);
-
- // now make the edges linked in sorted order
- for (int i = 1; i < count; i++)
- {
- list[i - 1]->fNext = list[i];
- list[i]->fPrev = list[i - 1];
- }
-
- *last = list[count - 1];
- return list[0];
-}
-
#ifdef SK_DEBUG
/* 'quick' computation of the max sized needed to allocated for
our edgelist.
@@ -466,6 +429,41 @@ static int cheap_worst_case_edge_count(const SkPath& path, size_t* storage) {
return edgeCount;
}
+///////////////////////////////////////////////////////////////////////////////
+
+extern "C" {
+ static int edge_compare(const void* a, const void* b) {
+ const SkEdge* edgea = *(const SkEdge**)a;
+ const SkEdge* edgeb = *(const SkEdge**)b;
+
+ int valuea = edgea->fFirstY;
+ int valueb = edgeb->fFirstY;
+
+ if (valuea == valueb) {
+ valuea = edgea->fX;
+ valueb = edgeb->fX;
+ }
+
+ // this overflows if valuea >>> valueb or vice-versa
+ // return valuea - valueb;
+ // do perform the slower but safe compares
+ return (valuea < valueb) ? -1 : (valuea > valueb);
+ }
+}
+
+static SkEdge* sort_edges(SkEdge* list[], int count, SkEdge** last) {
+ qsort(list, count, sizeof(SkEdge*), edge_compare);
+
+ // now make the edges linked in sorted order
+ for (int i = 1; i < count; i++) {
+ list[i - 1]->fNext = list[i];
+ list[i]->fPrev = list[i - 1];
+ }
+
+ *last = list[count - 1];
+ return list[0];
+}
+
// clipRect may be null, even though we always have a clip. This indicates that
// the path is contained in the clip, and so we can ignore it during the blit
//