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
33ab0ee6
Commit
33ab0ee6
authored
Mar 08, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2504 from Hixie/scene-builder-arg
Drop the argument to SceneBuilder's constructor
parents
f3e3b845
a16f07d9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
31 deletions
+6
-31
canvas.dart
examples/layers/raw/canvas.dart
+1
-7
hello_world.dart
examples/layers/raw/hello_world.dart
+1
-1
spinning_square.dart
examples/layers/raw/spinning_square.dart
+1
-7
text.dart
examples/layers/raw/text.dart
+1
-7
touch_input.dart
examples/layers/raw/touch_input.dart
+1
-7
view.dart
packages/flutter/lib/src/rendering/view.dart
+1
-2
No files found.
examples/layers/raw/canvas.dart
View file @
33ab0ee6
...
...
@@ -69,18 +69,12 @@ ui.Picture paint(ui.Rect paintBounds) {
ui
.
Scene
composite
(
ui
.
Picture
picture
,
ui
.
Rect
paintBounds
)
{
final
double
devicePixelRatio
=
ui
.
window
.
devicePixelRatio
;
ui
.
Rect
sceneBounds
=
new
ui
.
Rect
.
fromLTWH
(
0.0
,
0.0
,
ui
.
window
.
size
.
width
*
devicePixelRatio
,
ui
.
window
.
size
.
height
*
devicePixelRatio
);
Float64List
deviceTransform
=
new
Float64List
(
16
)
..[
0
]
=
devicePixelRatio
..[
5
]
=
devicePixelRatio
..[
10
]
=
1.0
..[
15
]
=
1.0
;
ui
.
SceneBuilder
sceneBuilder
=
new
ui
.
SceneBuilder
(
sceneBounds
)
ui
.
SceneBuilder
sceneBuilder
=
new
ui
.
SceneBuilder
()
..
pushTransform
(
deviceTransform
)
..
addPicture
(
ui
.
Offset
.
zero
,
picture
)
..
pop
();
...
...
examples/layers/raw/hello_world.dart
View file @
33ab0ee6
...
...
@@ -28,7 +28,7 @@ void beginFrame(Duration timeStamp) {
));
final
ui
.
Picture
picture
=
recorder
.
endRecording
();
final
ui
.
SceneBuilder
sceneBuilder
=
new
ui
.
SceneBuilder
(
physicalBounds
)
final
ui
.
SceneBuilder
sceneBuilder
=
new
ui
.
SceneBuilder
()
// TODO(abarth): We should be able to add a picture without pushing a
// container layer first.
..
pushClipRect
(
physicalBounds
)
...
...
examples/layers/raw/spinning_square.dart
View file @
33ab0ee6
...
...
@@ -36,18 +36,12 @@ void beginFrame(Duration timeStamp) {
// COMPOSITE
final
double
devicePixelRatio
=
ui
.
window
.
devicePixelRatio
;
ui
.
Rect
sceneBounds
=
new
ui
.
Rect
.
fromLTWH
(
0.0
,
0.0
,
ui
.
window
.
size
.
width
*
devicePixelRatio
,
ui
.
window
.
size
.
height
*
devicePixelRatio
);
Float64List
deviceTransform
=
new
Float64List
(
16
)
..[
0
]
=
devicePixelRatio
..[
5
]
=
devicePixelRatio
..[
10
]
=
1.0
..[
15
]
=
1.0
;
ui
.
SceneBuilder
sceneBuilder
=
new
ui
.
SceneBuilder
(
sceneBounds
)
ui
.
SceneBuilder
sceneBuilder
=
new
ui
.
SceneBuilder
()
..
pushTransform
(
deviceTransform
)
..
addPicture
(
ui
.
Offset
.
zero
,
picture
)
..
pop
();
...
...
examples/layers/raw/text.dart
View file @
33ab0ee6
...
...
@@ -28,18 +28,12 @@ ui.Picture paint(ui.Rect paintBounds) {
ui
.
Scene
composite
(
ui
.
Picture
picture
,
ui
.
Rect
paintBounds
)
{
final
double
devicePixelRatio
=
ui
.
window
.
devicePixelRatio
;
ui
.
Rect
sceneBounds
=
new
ui
.
Rect
.
fromLTWH
(
0.0
,
0.0
,
ui
.
window
.
size
.
width
*
devicePixelRatio
,
ui
.
window
.
size
.
height
*
devicePixelRatio
);
Float64List
deviceTransform
=
new
Float64List
(
16
)
..[
0
]
=
devicePixelRatio
..[
5
]
=
devicePixelRatio
..[
10
]
=
1.0
..[
15
]
=
1.0
;
ui
.
SceneBuilder
sceneBuilder
=
new
ui
.
SceneBuilder
(
sceneBounds
)
ui
.
SceneBuilder
sceneBuilder
=
new
ui
.
SceneBuilder
()
..
pushTransform
(
deviceTransform
)
..
addPicture
(
ui
.
Offset
.
zero
,
picture
)
..
pop
();
...
...
examples/layers/raw/touch_input.dart
View file @
33ab0ee6
...
...
@@ -48,12 +48,6 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
// pixels, which are then scalled by the device pixel ratio before being drawn
// on the screen.
final
double
devicePixelRatio
=
ui
.
window
.
devicePixelRatio
;
ui
.
Rect
sceneBounds
=
new
ui
.
Rect
.
fromLTWH
(
0.0
,
0.0
,
ui
.
window
.
size
.
width
*
devicePixelRatio
,
ui
.
window
.
size
.
height
*
devicePixelRatio
);
// This transform scales the x and y coordinates by the devicePixelRatio.
Float64List
deviceTransform
=
new
Float64List
(
16
)
...
...
@@ -66,7 +60,7 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
// transform that scale its children by the device pixel ratio. This transform
// lets us paint in "logical" pixels which are converted to device pixels by
// this scaling operation.
ui
.
SceneBuilder
sceneBuilder
=
new
ui
.
SceneBuilder
(
sceneBounds
)
ui
.
SceneBuilder
sceneBuilder
=
new
ui
.
SceneBuilder
()
..
pushTransform
(
deviceTransform
)
..
addPicture
(
ui
.
Offset
.
zero
,
picture
)
..
pop
();
...
...
packages/flutter/lib/src/rendering/view.dart
View file @
33ab0ee6
...
...
@@ -122,8 +122,7 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
try
{
final
TransformLayer
transformLayer
=
layer
;
transformLayer
.
transform
=
_logicalToDeviceTransform
;
Rect
bounds
=
Point
.
origin
&
(
size
*
ui
.
window
.
devicePixelRatio
);
ui
.
SceneBuilder
builder
=
new
ui
.
SceneBuilder
(
bounds
);
ui
.
SceneBuilder
builder
=
new
ui
.
SceneBuilder
();
transformLayer
.
addToScene
(
builder
,
Offset
.
zero
);
assert
(
layer
==
transformLayer
);
ui
.
Scene
scene
=
builder
.
build
();
...
...
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