Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e0f14e37
Commit
e0f14e37
authored
Aug 14, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add debug painting for layer borders
This patch makes it easier to debug layerization issues.
parent
86da2f9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
debug.dart
packages/flutter/lib/base/debug.dart
+3
-0
layer.dart
packages/flutter/lib/rendering/layer.dart
+13
-0
No files found.
packages/flutter/lib/base/debug.dart
View file @
e0f14e37
...
@@ -23,6 +23,9 @@ bool debugPaintBaselinesEnabled = false;
...
@@ -23,6 +23,9 @@ bool debugPaintBaselinesEnabled = false;
const
sky
.
Color
debugPaintAlphabeticBaselineColor
=
const
sky
.
Color
(
0xFF00FF00
);
const
sky
.
Color
debugPaintAlphabeticBaselineColor
=
const
sky
.
Color
(
0xFF00FF00
);
const
sky
.
Color
debugPaintIdeographicBaselineColor
=
const
sky
.
Color
(
0xFFFFD000
);
const
sky
.
Color
debugPaintIdeographicBaselineColor
=
const
sky
.
Color
(
0xFFFFD000
);
bool
debugPaintLayerBordersEnabled
=
false
;
const
sky
.
Color
debugPaintLayerBordersColor
=
const
sky
.
Color
(
0xFFFF9800
);
bool
debugPaintBoundsEnabled
=
false
;
bool
debugPaintBoundsEnabled
=
false
;
double
timeDilation
=
1.0
;
double
timeDilation
=
1.0
;
packages/flutter/lib/rendering/layer.dart
View file @
e0f14e37
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
import
'dart:sky'
as
sky
;
import
'dart:sky'
as
sky
;
import
'dart:sky'
show
Point
,
Offset
,
Size
,
Rect
,
Color
,
Paint
,
Path
;
import
'dart:sky'
show
Point
,
Offset
,
Size
,
Rect
,
Color
,
Paint
,
Path
;
import
'package:sky/base/debug.dart'
;
import
'package:vector_math/vector_math.dart'
;
import
'package:vector_math/vector_math.dart'
;
abstract
class
Layer
{
abstract
class
Layer
{
...
@@ -36,9 +37,21 @@ class PictureLayer extends Layer {
...
@@ -36,9 +37,21 @@ class PictureLayer extends Layer {
Size
size
;
Size
size
;
sky
.
Picture
picture
;
sky
.
Picture
picture
;
bool
_debugPaintLayerBorder
(
sky
.
Canvas
canvas
)
{
if
(
debugPaintLayerBordersEnabled
)
{
Paint
border
=
new
Paint
()
..
color
=
debugPaintLayerBordersColor
..
strokeWidth
=
2.0
..
setStyle
(
sky
.
PaintingStyle
.
stroke
);
canvas
.
drawRect
(
Point
.
origin
&
size
,
border
);
}
return
true
;
}
void
paint
(
sky
.
Canvas
canvas
)
{
void
paint
(
sky
.
Canvas
canvas
)
{
canvas
.
translate
(
offset
.
dx
,
offset
.
dy
);
canvas
.
translate
(
offset
.
dx
,
offset
.
dy
);
canvas
.
drawPicture
(
picture
);
canvas
.
drawPicture
(
picture
);
assert
(
_debugPaintLayerBorder
(
canvas
));
canvas
.
translate
(-
offset
.
dx
,
-
offset
.
dy
);
canvas
.
translate
(-
offset
.
dx
,
-
offset
.
dy
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment