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
febfdf69
Commit
febfdf69
authored
Mar 30, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3014 from abarth/update_mojo
Update engine
parents
a2d322c0
04adf211
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
16 deletions
+35
-16
engine.version
bin/cache/engine.version
+1
-1
child_view.dart
packages/flutter/lib/src/rendering/child_view.dart
+34
-15
No files found.
bin/cache/engine.version
View file @
febfdf69
516c096d987f9b04ac24af440396f693947e98ab
3d944e1c36ebe543e16ecd808336594340186fe4
packages/flutter/lib/src/rendering/child_view.dart
View file @
febfdf69
...
...
@@ -8,11 +8,12 @@ import 'dart:ui' as ui;
import
'package:flutter/services.dart'
;
import
'package:mojo_services/mojo/gfx/composition/scene_token.mojom.dart'
as
mojom
;
import
'package:mojo_services/mojo/ui/layouts.mojom.dart'
as
mojom
;
import
'package:mojo_services/mojo/ui/view_containers.mojom.dart'
as
mojom
;
import
'package:mojo_services/mojo/ui/view_provider.mojom.dart'
as
mojom
;
import
'package:mojo_services/mojo/ui/view_properties.mojom.dart'
as
mojom
;
import
'package:mojo_services/mojo/ui/view_token.mojom.dart'
as
mojom
;
import
'package:mojo_services/mojo/ui/views.mojom.dart'
as
mojom
;
import
'package:mojo_services/mojo/geometry.mojom.dart'
as
mojom
;
import
'package:mojo/application.dart'
;
import
'package:mojo/core.dart'
as
core
;
import
'package:mojo/mojo/service_provider.mojom.dart'
as
mojom
;
...
...
@@ -102,6 +103,9 @@ class ChildViewConnection {
static
int
_nextViewKey
=
1
;
int
_viewKey
;
int
_sceneVersion
=
1
;
mojom
.
ViewProperties
_currentViewProperties
;
VoidCallback
_onViewInfoAvailable
;
mojom
.
ViewInfo
_viewInfo
;
...
...
@@ -138,6 +142,7 @@ class ChildViewConnection {
_viewContainer
?.
removeChild
(
_viewKey
,
_viewOwner
);
_viewKey
=
null
;
_viewInfo
=
null
;
_currentViewProperties
=
null
;
}
// The number of render objects attached to this view. In between frames, we
...
...
@@ -166,24 +171,38 @@ class ChildViewConnection {
_removeChildFromViewHost
();
}
void
_layout
({
int
physicalWidth
,
int
physicalHeight
,
double
devicePixelRatio
})
{
mojom
.
ViewProperties
_createViewProperties
(
int
physicalWidth
,
int
physicalHeight
,
double
devicePixelRatio
)
{
if
(
_currentViewProperties
!=
null
&&
_currentViewProperties
.
displayMetrics
.
devicePixelRatio
==
devicePixelRatio
&&
_currentViewProperties
.
viewLayout
.
size
.
width
==
physicalWidth
&&
_currentViewProperties
.
viewLayout
.
size
.
height
==
physicalHeight
)
return
null
;
mojom
.
DisplayMetrics
displayMetrics
=
new
mojom
.
DisplayMetrics
()
..
devicePixelRatio
=
devicePixelRatio
;
mojom
.
Size
size
=
new
mojom
.
Size
()
..
width
=
physicalWidth
..
height
=
physicalHeight
;
mojom
.
ViewLayout
viewLayout
=
new
mojom
.
ViewLayout
()
..
size
=
size
;
_currentViewProperties
=
new
mojom
.
ViewProperties
()
..
displayMetrics
=
displayMetrics
..
viewLayout
=
viewLayout
;
return
_currentViewProperties
;
}
void
_setChildProperties
(
int
physicalWidth
,
int
physicalHeight
,
double
devicePixelRatio
)
{
assert
(
_attached
);
assert
(
_attachments
==
1
);
assert
(
_viewKey
!=
null
);
if
(
_view
==
null
)
return
;
// TODO(abarth): Ideally we would propagate our actual constraints to be
// able to support rich cross-app layout. For now, we give the child tight
// constraints for simplicity.
mojom
.
BoxConstraints
childConstraints
=
new
mojom
.
BoxConstraints
()
..
minWidth
=
physicalWidth
..
maxWidth
=
physicalWidth
..
minHeight
=
physicalHeight
..
maxHeight
=
physicalHeight
;
mojom
.
ViewLayoutParams
layoutParams
=
new
mojom
.
ViewLayoutParams
()
..
constraints
=
childConstraints
..
devicePixelRatio
=
devicePixelRatio
;
_viewContainer
.
layoutChild
(
_viewKey
,
layoutParams
);
mojom
.
ViewProperties
viewProperties
=
_createViewProperties
(
physicalWidth
,
physicalHeight
,
devicePixelRatio
);
if
(
viewProperties
==
null
)
return
;
_viewContainer
.
setChildProperties
(
_viewKey
,
_sceneVersion
++,
viewProperties
);
}
}
...
...
@@ -257,7 +276,7 @@ class RenderChildView extends RenderBox {
if
(
_child
!=
null
)
{
_physicalWidth
=
(
size
.
width
*
scale
).
round
();
_physicalHeight
=
(
size
.
height
*
scale
).
round
();
_child
.
_
layout
(
physicalWidth:
_physicalWidth
,
physicalHeight:
_physicalHeight
,
devicePixelRatio:
scale
);
_child
.
_
setChildProperties
(
_physicalWidth
,
_physicalHeight
,
scale
);
assert
(()
{
if
(
_view
==
null
)
{
_debugErrorMessage
??=
new
TextPainter
()
...
...
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