Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
Path_updateBoundsCache.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Path_updateBoundsCache, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Path_updateBoundsCache  ,
256  ,
256  ,
true  ,
 
)

Definition at line 5 of file Path_updateBoundsCache.cpp.

5 {
6void draw(SkCanvas* canvas) {
7 double times[2] = { 0, 0 };
8 int N = 100;
9 for (int i = 0; i < N; ++i) {
11 for (int j = 1; j < 100; ++ j) {
12 path.addCircle(50 + j, 45 + j, 25 + j);
13 }
14 if (1 & i) {
15 path.updateBoundsCache();
16 }
17 double start = SkTime::GetNSecs();
18 (void) path.getBounds();
19 times[1 & i] += SkTime::GetNSecs() - start;
20 }
21 SkDebugf("uncached avg: %g ms\n", times[0] / (double)N);
22 SkDebugf("cached avg: %g ms\n", times[1] / (double)N);
23}
24} // END FIDDLE
static SkISize times(const SkISize &size, float factor)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
#define N
Definition beziers.cpp:19
double GetNSecs()
Definition SkTime.cpp:17
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57