-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix .gitignore and remove uneeded import
- Loading branch information
1 parent
bd869ab
commit 2fc24e1
Showing
3 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,8 +42,6 @@ local.properties | |
*.sln.docstates | ||
|
||
# Build results | ||
[Dd]ebug/ | ||
[Rr]elease/ | ||
*_i.c | ||
*_p.c | ||
*.ilk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package haxe.ui.debug; | ||
|
||
import haxe.ui.core.Component; | ||
import haxe.ui.util.CallStackHelper; | ||
|
||
class DebugCounter { | ||
public var name:String; | ||
private var _counters:Map<String, Int> = new Map<String, Int>(); | ||
private var _stacks:Map<String, Int> = new Map<String, Int>(); | ||
|
||
public function new(name:String = null) { | ||
this.name = name; | ||
} | ||
|
||
public function incrementComponent(component:Component, fn:String = null, by:Int = 1) { | ||
var key:String = buildComponentKey(component); | ||
if (fn != null) { | ||
key += '::${fn}'; | ||
} | ||
if (_counters.exists(key) == false) { | ||
_counters.set(key, 0); | ||
} | ||
_counters.set(key, _counters.get(key) + by); | ||
|
||
var stack:String = CallStackHelper.getCallStackString(); | ||
CallStackHelper.traceCallStack(); | ||
if (_stacks.exists(stack) == false) { | ||
_stacks.set(stack, 0); | ||
} | ||
_stacks.set(stack, _stacks.get(stack) + 1); | ||
} | ||
|
||
public function list() { | ||
trace("--------------------------------------------------------------------------------"); | ||
var total:Int = 0; | ||
for (key in _counters.keys()) { | ||
trace('${key} - ${_counters.get(key)}'); | ||
total += _counters.get(key); | ||
} | ||
trace('total: ${total}'); | ||
trace("--------------------------------------------------------------------------------"); | ||
for (stack in _stacks.keys()) { | ||
trace(stack); | ||
trace("STACK COUNT: " + _stacks.get(stack)); | ||
trace("--------------------------------------------------------------------------------"); | ||
} | ||
} | ||
|
||
private function buildComponentKey(component:Component):String { | ||
return '${component}#${component.id}'; | ||
} | ||
} |