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
017b4230
Commit
017b4230
authored
Mar 03, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2358 from abarth/update_engine
Update engine
parents
60b81271
865e3cc0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
66 deletions
+26
-66
dart-sdk.version
bin/cache/dart-sdk.version
+1
-1
engine.version
bin/cache/engine.version
+1
-1
child_view.dart
packages/flutter/lib/src/rendering/child_view.dart
+23
-58
drag_target.dart
packages/flutter/lib/src/widgets/drag_target.dart
+1
-6
No files found.
bin/cache/dart-sdk.version
View file @
017b4230
1.15.0-dev.
4
.0
1.15.0-dev.
5
.0
bin/cache/engine.version
View file @
017b4230
d474e9d2b60a9cb111c09844c10081b68bde9252
abd1afd598b659b3c1033cc52eedbc4a4069ac7d
packages/flutter/lib/src/rendering/child_view.dart
View file @
017b4230
...
@@ -17,14 +17,14 @@ import 'package:mojo/mojo/service_provider.mojom.dart' as mojom;
...
@@ -17,14 +17,14 @@ import 'package:mojo/mojo/service_provider.mojom.dart' as mojom;
import
'box.dart'
;
import
'box.dart'
;
import
'object.dart'
;
import
'object.dart'
;
mojom
.
View
HostProxy
_initViewHost
Proxy
(
)
{
mojom
.
View
Proxy
_initView
Proxy
(
)
{
int
viewH
ost
=
ui
.
takeViewHost
Handle
();
int
viewH
andle
=
ui
.
takeView
Handle
();
assert
(()
{
assert
(()
{
if
(
viewH
ost
==
0
)
if
(
viewH
andle
==
0
)
debugPrint
(
'Child view are supported only when running in Mojo shell.'
);
debugPrint
(
'Child view are supported only when running in Mojo shell.'
);
return
true
;
return
true
;
});
});
return
new
mojom
.
View
HostProxy
.
fromHandle
(
new
core
.
MojoHandle
(
viewHost
));
return
new
mojom
.
View
Proxy
.
fromHandle
(
new
core
.
MojoHandle
(
viewHandle
));
}
}
// TODO(abarth): The view host is a unique resource. We should structure how we
// TODO(abarth): The view host is a unique resource. We should structure how we
...
@@ -32,17 +32,18 @@ mojom.ViewHostProxy _initViewHostProxy() {
...
@@ -32,17 +32,18 @@ mojom.ViewHostProxy _initViewHostProxy() {
// the view host safely. Unfortunately, the view host has a global namespace of
// the view host safely. Unfortunately, the view host has a global namespace of
// view keys, which means any scheme for sharing the view host also needs to
// view keys, which means any scheme for sharing the view host also needs to
// provide a mechanism for coordinating about view keys.
// provide a mechanism for coordinating about view keys.
final
mojom
.
View
HostProxy
_viewHostProxy
=
_initViewHost
Proxy
();
final
mojom
.
View
Proxy
_viewProxy
=
_initView
Proxy
();
final
mojom
.
View
Host
_viewHost
=
_viewHost
Proxy
?.
ptr
;
final
mojom
.
View
_view
=
_view
Proxy
?.
ptr
;
class
ChildViewConnection
{
class
ChildViewConnection
{
ChildViewConnection
({
this
.
url
})
{
ChildViewConnection
({
this
.
url
})
{
mojom
.
ServiceProviderProxy
incomingServices
=
new
mojom
.
ServiceProviderProxy
.
unbound
();
mojom
.
ServiceProviderStub
outgoingServices
=
new
mojom
.
ServiceProviderStub
.
unbound
();
assert
(
_viewToken
==
null
);
mojom
.
ViewProviderProxy
viewProvider
=
new
mojom
.
ViewProviderProxy
.
unbound
();
mojom
.
ViewProviderProxy
viewProvider
=
new
mojom
.
ViewProviderProxy
.
unbound
();
shell
.
connectToService
(
url
,
viewProvider
);
shell
.
connectToService
(
url
,
viewProvider
);
_unresolvedViewToken
=
_awaitResponse
(
viewProvider
.
ptr
.
createView
(
incomingServices
,
outgoingServices
),
viewProvider
);
mojom
.
ServiceProviderProxy
incomingServices
=
new
mojom
.
ServiceProviderProxy
.
unbound
();
mojom
.
ServiceProviderStub
outgoingServices
=
new
mojom
.
ServiceProviderStub
.
unbound
();
_viewOwner
=
new
mojom
.
ViewOwnerProxy
.
unbound
();
viewProvider
.
ptr
.
createView
(
_viewOwner
,
incomingServices
,
outgoingServices
);
viewProvider
.
close
();
_connection
=
new
ApplicationConnection
(
outgoingServices
,
incomingServices
);
_connection
=
new
ApplicationConnection
(
outgoingServices
,
incomingServices
);
}
}
...
@@ -51,39 +52,26 @@ class ChildViewConnection {
...
@@ -51,39 +52,26 @@ class ChildViewConnection {
ApplicationConnection
get
connection
=>
_connection
;
ApplicationConnection
get
connection
=>
_connection
;
ApplicationConnection
_connection
;
ApplicationConnection
_connection
;
Future
<
mojom
.
ViewToken
>
_unresolvedViewToken
;
mojom
.
ViewOwnerProxy
_viewOwner
;
mojom
.
ViewToken
_viewToken
;
Future
<
mojom
.
ViewToken
>
_awaitResponse
(
Future
<
mojom
.
ViewProviderCreateViewResponseParams
>
response
,
mojom
.
ViewProviderProxy
viewProvider
)
async
{
mojom
.
ViewToken
viewToken
=
(
await
response
).
viewToken
;
viewProvider
.
close
();
assert
(
_viewToken
==
null
);
_viewToken
=
viewToken
;
assert
(
_viewKey
==
null
);
if
(
_attached
)
_addChildToViewHost
();
return
viewToken
;
}
static
int
_nextViewKey
=
1
;
static
int
_nextViewKey
=
1
;
int
_viewKey
;
int
_viewKey
;
void
_addChildToViewHost
()
{
void
_addChildToViewHost
()
{
assert
(
_attached
);
assert
(
_attached
);
assert
(
_view
Token
!=
null
);
assert
(
_view
Owner
!=
null
);
assert
(
_viewKey
==
null
);
assert
(
_viewKey
==
null
);
_viewKey
=
_nextViewKey
++;
_viewKey
=
_nextViewKey
++;
_viewHost
.
addChild
(
_viewKey
,
_viewToken
);
_view
.
addChild
(
_viewKey
,
_viewOwner
.
impl
);
_viewOwner
=
null
;
}
}
void
_removeChildFromViewHost
()
{
void
_removeChildFromViewHost
()
{
assert
(!
_attached
);
assert
(!
_attached
);
assert
(
_view
Token
!
=
null
);
assert
(
_view
Owner
=
=
null
);
assert
(
_viewKey
!=
null
);
assert
(
_viewKey
!=
null
);
_viewHost
.
removeChild
(
_viewKey
);
_viewOwner
=
new
mojom
.
ViewOwnerProxy
.
unbound
();
_view
.
removeChild
(
_viewKey
,
_viewOwner
);
_viewKey
=
null
;
_viewKey
=
null
;
}
}
...
@@ -97,7 +85,7 @@ class ChildViewConnection {
...
@@ -97,7 +85,7 @@ class ChildViewConnection {
void
_attach
()
{
void
_attach
()
{
assert
(
_attachments
>=
0
);
assert
(
_attachments
>=
0
);
++
_attachments
;
++
_attachments
;
if
(
_view
Token
!=
null
&&
_view
Key
==
null
)
if
(
_viewKey
==
null
)
_addChildToViewHost
();
_addChildToViewHost
();
}
}
...
@@ -130,7 +118,7 @@ class ChildViewConnection {
...
@@ -130,7 +118,7 @@ class ChildViewConnection {
mojom
.
ViewLayoutParams
layoutParams
=
new
mojom
.
ViewLayoutParams
()
mojom
.
ViewLayoutParams
layoutParams
=
new
mojom
.
ViewLayoutParams
()
..
constraints
=
childConstraints
..
constraints
=
childConstraints
..
devicePixelRatio
=
scale
;
..
devicePixelRatio
=
scale
;
return
(
await
_view
Host
.
layoutChild
(
_viewKey
,
layoutParams
)).
info
;
return
(
await
_view
.
layoutChild
(
_viewKey
,
layoutParams
)).
info
;
}
}
String
toString
()
{
String
toString
()
{
...
@@ -142,10 +130,7 @@ class RenderChildView extends RenderBox {
...
@@ -142,10 +130,7 @@ class RenderChildView extends RenderBox {
RenderChildView
({
RenderChildView
({
ChildViewConnection
child
,
ChildViewConnection
child
,
double
scale
double
scale
})
:
_child
=
child
,
_scale
=
scale
{
})
:
_child
=
child
,
_scale
=
scale
;
if
(
_child
!=
null
)
_awaitViewToken
();
}
ChildViewConnection
get
child
=>
_child
;
ChildViewConnection
get
child
=>
_child
;
ChildViewConnection
_child
;
ChildViewConnection
_child
;
...
@@ -158,26 +143,13 @@ class RenderChildView extends RenderBox {
...
@@ -158,26 +143,13 @@ class RenderChildView extends RenderBox {
_layoutInfo
=
null
;
_layoutInfo
=
null
;
if
(
attached
)
if
(
attached
)
_child
?.
_attach
();
_child
?.
_attach
();
if
(
_child
==
null
)
{
if
(
_child
==
null
)
{
markNeedsPaint
();
markNeedsPaint
();
}
else
if
(
_child
.
_viewToken
!=
null
)
{
// We've already connected to the view, so we're ready to invalidate our
// layout immediately.
markNeedsLayout
();
}
else
{
}
else
{
// Otherwise, we're still in the process of connecting, so we need to
markNeedsLayout
();
// repaint now (to remove any old child view), and we need to watch for
// the view token resolving before attempting layout.
markNeedsPaint
();
_awaitViewToken
();
}
}
}
}
void
_awaitViewToken
()
{
_child
.
_unresolvedViewToken
.
then
(
_handleViewTokenResolved
);
}
double
get
scale
=>
_scale
;
double
get
scale
=>
_scale
;
double
_scale
;
double
_scale
;
void
set
scale
(
double
value
)
{
void
set
scale
(
double
value
)
{
...
@@ -206,7 +178,7 @@ class RenderChildView extends RenderBox {
...
@@ -206,7 +178,7 @@ class RenderChildView extends RenderBox {
}
}
void
performLayout
()
{
void
performLayout
()
{
if
(
_child
!=
null
&&
_child
.
_viewToken
!=
null
)
if
(
_child
!=
null
)
_child
.
_layout
(
size:
size
,
scale:
scale
).
then
(
_handleLayoutInfoChanged
);
_child
.
_layout
(
size:
size
,
scale:
scale
).
then
(
_handleLayoutInfoChanged
);
}
}
...
@@ -217,13 +189,6 @@ class RenderChildView extends RenderBox {
...
@@ -217,13 +189,6 @@ class RenderChildView extends RenderBox {
markNeedsPaint
();
markNeedsPaint
();
}
}
void
_handleViewTokenResolved
(
mojom
.
ViewToken
viewToken
)
{
// The _viewToken might not match viewToken if _child changed between the
// time we started waiting for the future and the time it resolved.
if
(
attached
&&
_child
?.
_viewToken
==
viewToken
)
markNeedsLayout
();
}
bool
hitTestSelf
(
Point
position
)
=>
true
;
bool
hitTestSelf
(
Point
position
)
=>
true
;
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
void
paint
(
PaintingContext
context
,
Offset
offset
)
{
...
...
packages/flutter/lib/src/widgets/drag_target.dart
View file @
017b4230
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:collection'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
...
@@ -324,10 +322,7 @@ class _DragTargetState<T> extends State<DragTarget<T>> {
...
@@ -324,10 +322,7 @@ class _DragTargetState<T> extends State<DragTarget<T>> {
return
new
MetaData
(
return
new
MetaData
(
metaData:
this
,
metaData:
this
,
behavior:
HitTestBehavior
.
translucent
,
behavior:
HitTestBehavior
.
translucent
,
child:
config
.
builder
(
context
,
child:
config
.
builder
(
context
,
_candidateData
,
_rejectedData
)
new
UnmodifiableListView
<
T
>(
_candidateData
),
new
UnmodifiableListView
<
dynamic
>(
_rejectedData
)
)
);
);
}
}
}
}
...
...
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