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
179ea4a0
Commit
179ea4a0
authored
Sep 15, 2016
by
Adam Barth
Committed by
GitHub
Sep 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update framework to account from engine API changes (#5887)
The engine now reports coordinates in physical pixels.
parent
9109bb02
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
41 additions
and
32 deletions
+41
-32
engine.version
bin/cache/engine.version
+1
-1
canvas.dart
examples/layers/raw/canvas.dart
+6
-3
hello_world.dart
examples/layers/raw/hello_world.dart
+1
-2
spinning_square.dart
examples/layers/raw/spinning_square.dart
+1
-1
text.dart
examples/layers/raw/text.dart
+5
-2
touch_input.dart
examples/layers/raw/touch_input.dart
+1
-1
icon_color_test.dart
examples/stocks/test/icon_color_test.dart
+2
-2
binding.dart
packages/flutter/lib/src/gestures/binding.dart
+1
-1
converter.dart
packages/flutter/lib/src/gestures/converter.dart
+2
-2
edge_insets.dart
packages/flutter/lib/src/painting/edge_insets.dart
+5
-2
text_style.dart
packages/flutter/lib/src/painting/text_style.dart
+2
-2
binding.dart
packages/flutter/lib/src/rendering/binding.dart
+3
-2
view.dart
packages/flutter/lib/src/rendering/view.dart
+2
-2
media_query.dart
packages/flutter/lib/src/widgets/media_query.dart
+2
-2
text_style_test.dart
packages/flutter/test/painting/text_style_test.dart
+4
-4
media_query_test.dart
packages/flutter/test/widget/media_query_test.dart
+1
-1
binding.dart
packages/flutter_test/lib/src/binding.dart
+2
-2
No files found.
bin/cache/engine.version
View file @
179ea4a0
e
9dd3e4e0dfb4fb6458ad5fde4218a3096022837
e
4121f80a9695d3f18e7d68e32ad60fc0a8f01b4
examples/layers/raw/canvas.dart
View file @
179ea4a0
...
...
@@ -29,10 +29,13 @@ ui.Picture paint(ui.Rect paintBounds) {
ui
.
Point
mid
=
size
.
center
(
ui
.
Point
.
origin
);
double
radius
=
size
.
shortestSide
/
2.0
;
final
double
devicePixelRatio
=
ui
.
window
.
devicePixelRatio
;
final
ui
.
Size
logicalSize
=
ui
.
window
.
physicalSize
/
devicePixelRatio
;
canvas
.
save
();
canvas
.
translate
(-
mid
.
x
/
2.0
,
ui
.
window
.
s
ize
.
height
*
2.0
);
canvas
.
translate
(-
mid
.
x
/
2.0
,
logicalS
ize
.
height
*
2.0
);
canvas
.
clipRect
(
new
ui
.
Rect
.
fromLTRB
(
0.0
,
-
ui
.
window
.
size
.
height
,
ui
.
window
.
s
ize
.
width
,
radius
));
new
ui
.
Rect
.
fromLTRB
(
0.0
,
-
logicalSize
.
height
,
logicalS
ize
.
width
,
radius
));
canvas
.
translate
(
mid
.
x
,
mid
.
y
);
paint
.
color
=
const
ui
.
Color
.
fromARGB
(
128
,
255
,
0
,
255
);
...
...
@@ -82,7 +85,7 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
}
void
beginFrame
(
Duration
timeStamp
)
{
ui
.
Rect
paintBounds
=
ui
.
Point
.
origin
&
ui
.
window
.
size
;
ui
.
Rect
paintBounds
=
ui
.
Point
.
origin
&
(
ui
.
window
.
physicalSize
/
ui
.
window
.
devicePixelRatio
)
;
ui
.
Picture
picture
=
paint
(
paintBounds
);
ui
.
Scene
scene
=
composite
(
picture
,
paintBounds
);
ui
.
window
.
render
(
scene
);
...
...
examples/layers/raw/hello_world.dart
View file @
179ea4a0
...
...
@@ -9,8 +9,7 @@ import 'dart:ui' as ui;
void
beginFrame
(
Duration
timeStamp
)
{
final
double
devicePixelRatio
=
ui
.
window
.
devicePixelRatio
;
// TODO(abarth): ui.window.size should be in physical units.
final
ui
.
Size
logicalSize
=
ui
.
window
.
size
;
final
ui
.
Size
logicalSize
=
ui
.
window
.
physicalSize
/
devicePixelRatio
;
final
ui
.
ParagraphBuilder
paragraphBuilder
=
new
ui
.
ParagraphBuilder
()
..
addText
(
'Hello, world.'
);
...
...
examples/layers/raw/spinning_square.dart
View file @
179ea4a0
...
...
@@ -19,7 +19,7 @@ void beginFrame(Duration timeStamp) {
// PAINT
ui
.
Rect
paintBounds
=
ui
.
Point
.
origin
&
ui
.
window
.
size
;
ui
.
Rect
paintBounds
=
ui
.
Point
.
origin
&
(
ui
.
window
.
physicalSize
/
ui
.
window
.
devicePixelRatio
)
;
ui
.
PictureRecorder
recorder
=
new
ui
.
PictureRecorder
();
ui
.
Canvas
canvas
=
new
ui
.
Canvas
(
recorder
,
paintBounds
);
canvas
.
translate
(
paintBounds
.
width
/
2.0
,
paintBounds
.
height
/
2.0
);
...
...
examples/layers/raw/text.dart
View file @
179ea4a0
...
...
@@ -15,7 +15,10 @@ ui.Picture paint(ui.Rect paintBounds) {
ui
.
PictureRecorder
recorder
=
new
ui
.
PictureRecorder
();
ui
.
Canvas
canvas
=
new
ui
.
Canvas
(
recorder
,
paintBounds
);
canvas
.
translate
(
ui
.
window
.
size
.
width
/
2.0
,
ui
.
window
.
size
.
height
/
2.0
);
final
double
devicePixelRatio
=
ui
.
window
.
devicePixelRatio
;
final
ui
.
Size
logicalSize
=
ui
.
window
.
physicalSize
/
devicePixelRatio
;
canvas
.
translate
(
logicalSize
.
width
/
2.0
,
logicalSize
.
height
/
2.0
);
canvas
.
drawRect
(
new
ui
.
Rect
.
fromLTRB
(-
100.0
,
-
100.0
,
100.0
,
100.0
),
new
ui
.
Paint
()..
color
=
const
ui
.
Color
.
fromARGB
(
255
,
0
,
255
,
0
));
...
...
@@ -41,7 +44,7 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
}
void
beginFrame
(
Duration
timeStamp
)
{
ui
.
Rect
paintBounds
=
ui
.
Point
.
origin
&
ui
.
window
.
size
;
ui
.
Rect
paintBounds
=
ui
.
Point
.
origin
&
(
ui
.
window
.
physicalSize
/
ui
.
window
.
devicePixelRatio
)
;
ui
.
Picture
picture
=
paint
(
paintBounds
);
ui
.
Scene
scene
=
composite
(
picture
,
paintBounds
);
ui
.
window
.
render
(
scene
);
...
...
examples/layers/raw/touch_input.dart
View file @
179ea4a0
...
...
@@ -71,7 +71,7 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
}
void
beginFrame
(
Duration
timeStamp
)
{
ui
.
Rect
paintBounds
=
ui
.
Point
.
origin
&
ui
.
window
.
size
;
ui
.
Rect
paintBounds
=
ui
.
Point
.
origin
&
(
ui
.
window
.
physicalSize
/
ui
.
window
.
devicePixelRatio
)
;
// First, record a picture with our painting commands.
ui
.
Picture
picture
=
paint
(
paintBounds
);
// Second, include that picture in a scene graph.
...
...
examples/stocks/test/icon_color_test.dart
View file @
179ea4a0
...
...
@@ -64,8 +64,8 @@ void main() {
expect
(
find
.
text
(
'Account Balance'
),
findsNothing
);
// drag the drawer out
Point
left
=
new
Point
(
0.0
,
ui
.
window
.
s
ize
.
height
/
2.0
);
Point
right
=
new
Point
(
ui
.
window
.
s
ize
.
width
,
left
.
y
);
Point
left
=
new
Point
(
0.0
,
ui
.
window
.
physicalS
ize
.
height
/
2.0
);
Point
right
=
new
Point
(
ui
.
window
.
physicalS
ize
.
width
,
left
.
y
);
TestGesture
gesture
=
await
tester
.
startGesture
(
left
);
await
tester
.
pump
();
await
gesture
.
moveTo
(
right
);
...
...
packages/flutter/lib/src/gestures/binding.dart
View file @
179ea4a0
...
...
@@ -40,7 +40,7 @@ abstract class GestureBinding extends BindingBase implements HitTestable, HitTes
0
);
final
PointerPacket
packet
=
PointerPacket
.
deserialize
(
message
);
_pendingPointerEvents
.
addAll
(
PointerEventConverter
.
expand
(
packet
.
pointers
));
_pendingPointerEvents
.
addAll
(
PointerEventConverter
.
expand
(
packet
.
pointers
,
ui
.
window
.
devicePixelRatio
));
_flushPointerEventQueue
();
}
...
...
packages/flutter/lib/src/gestures/converter.dart
View file @
179ea4a0
...
...
@@ -37,9 +37,9 @@ class PointerEventConverter {
static
Map
<
int
,
_PointerState
>
_pointers
=
<
int
,
_PointerState
>{};
/// Expand the given packet of pointer data into a sequence of framework pointer events.
static
Iterable
<
PointerEvent
>
expand
(
Iterable
<
mojom
.
Pointer
>
packet
)
sync
*
{
static
Iterable
<
PointerEvent
>
expand
(
Iterable
<
mojom
.
Pointer
>
packet
,
double
devicePixelRatio
)
sync
*
{
for
(
mojom
.
Pointer
datum
in
packet
)
{
Point
position
=
new
Point
(
datum
.
x
,
datum
.
y
);
Point
position
=
new
Point
(
datum
.
x
,
datum
.
y
)
/
devicePixelRatio
;
Duration
timeStamp
=
new
Duration
(
microseconds:
datum
.
timeStamp
);
assert
(
_pointerKindMap
.
containsKey
(
datum
.
kind
));
PointerDeviceKind
kind
=
_pointerKindMap
[
datum
.
kind
];
...
...
packages/flutter/lib/src/painting/edge_insets.dart
View file @
179ea4a0
...
...
@@ -41,8 +41,11 @@ class EdgeInsets {
:
left
=
horizontal
,
top
=
vertical
,
right
=
horizontal
,
bottom
=
vertical
;
/// Creates insets that match the given window padding.
EdgeInsets
.
fromWindowPadding
(
ui
.
WindowPadding
padding
)
:
left
=
padding
.
left
,
top
=
padding
.
top
,
right
=
padding
.
right
,
bottom
=
padding
.
bottom
;
EdgeInsets
.
fromWindowPadding
(
ui
.
WindowPadding
padding
,
double
devicePixelRatio
)
:
left
=
padding
.
left
/
devicePixelRatio
,
top
=
padding
.
top
/
devicePixelRatio
,
right
=
padding
.
right
/
devicePixelRatio
,
bottom
=
padding
.
bottom
/
devicePixelRatio
;
/// The offset from the left.
final
double
left
;
...
...
packages/flutter/lib/src/painting/text_style.dart
View file @
179ea4a0
...
...
@@ -49,7 +49,7 @@ class TextStyle {
/// The amount of space (in logical pixels) to add at each sequence of white-space (i.e. between each word).
final
double
wordSpacing
;
/// The
baseline to use for aligning the text
.
/// The
common baseline that should be aligned between this text span and its parent text span, or, for the root text spans, with the line box
.
final
TextBaseline
textBaseline
;
/// The height of this text span, as a multiple of the font size.
...
...
@@ -213,6 +213,7 @@ class TextStyle {
decorationStyle:
decorationStyle
,
fontWeight:
fontWeight
,
fontStyle:
fontStyle
,
textBaseline:
textBaseline
,
fontFamily:
fontFamily
,
fontSize:
fontSize
,
letterSpacing:
letterSpacing
,
...
...
@@ -225,7 +226,6 @@ class TextStyle {
ui
.
ParagraphStyle
getParagraphStyle
({
TextAlign
textAlign
})
{
return
new
ui
.
ParagraphStyle
(
textAlign:
textAlign
,
textBaseline:
textBaseline
,
fontWeight:
fontWeight
,
fontStyle:
fontStyle
,
fontFamily:
fontFamily
,
...
...
packages/flutter/lib/src/rendering/binding.dart
View file @
179ea4a0
...
...
@@ -123,9 +123,10 @@ abstract class RendererBinding extends BindingBase implements SchedulerBinding,
/// this to force the display into 800x600 when a test is run on the device
/// using `flutter run`.
ViewConfiguration
createViewConfiguration
()
{
final
double
devicePixelRatio
=
ui
.
window
.
devicePixelRatio
;
return
new
ViewConfiguration
(
size:
ui
.
window
.
size
,
devicePixelRatio:
ui
.
window
.
devicePixelRatio
size:
ui
.
window
.
physicalSize
/
devicePixelRatio
,
devicePixelRatio:
devicePixelRatio
);
}
...
...
packages/flutter/lib/src/rendering/view.dart
View file @
179ea4a0
...
...
@@ -171,8 +171,8 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
@override
void
debugFillDescription
(
List
<
String
>
description
)
{
// call to ${super.debugFillDescription(prefix)} is omitted because the root superclasses don't include any interesting information for this class
description
.
add
(
'window size:
${ui.window.
size}
(in device
pixels)'
);
description
.
add
(
'device pixel ratio:
${ui.window.devicePixelRatio}
(
device
pixels per logical pixel)'
);
description
.
add
(
'window size:
${ui.window.
physicalSize}
(in physical
pixels)'
);
description
.
add
(
'device pixel ratio:
${ui.window.devicePixelRatio}
(
physical
pixels per logical pixel)'
);
description
.
add
(
'configuration:
$configuration
(in logical pixels)'
);
}
}
packages/flutter/lib/src/widgets/media_query.dart
View file @
179ea4a0
...
...
@@ -35,9 +35,9 @@ class MediaQueryData {
/// Creates data for a media query based on the given window.
MediaQueryData
.
fromWindow
(
ui
.
Window
window
)
:
size
=
window
.
size
,
:
size
=
window
.
physicalSize
/
window
.
devicePixelRatio
,
devicePixelRatio
=
window
.
devicePixelRatio
,
padding
=
new
EdgeInsets
.
fromWindowPadding
(
window
.
padding
);
padding
=
new
EdgeInsets
.
fromWindowPadding
(
window
.
padding
,
window
.
devicePixelRatio
);
/// The size of the media in logical pixel (e.g, the size of the screen).
///
...
...
packages/flutter/test/painting/text_style_test.dart
View file @
179ea4a0
...
...
@@ -91,16 +91,16 @@ void main() {
ui
.
TextStyle
ts5
=
s5
.
textStyle
;
expect
(
ts5
,
equals
(
new
ui
.
TextStyle
(
fontWeight:
FontWeight
.
w700
,
fontSize:
12.0
,
height:
123.0
)));
expect
(
ts5
.
toString
(),
'TextStyle(
2336|color: unspecified, decoration: unspecified, decorationColor: unspecified, decorationStyle: unspecified, fontWeight: FontWeight.w700, fontStyl
e: unspecified, fontFamily: unspecified, fontSize: 12.0, letterSpacing: unspecified, wordSpacing: unspecified, height: 123.0x)'
);
expect
(
ts5
.
toString
(),
'TextStyle(
color: unspecified, decoration: unspecified, decorationColor: unspecified, decorationStyle: unspecified, fontWeight: FontWeight.w700, fontStyle: unspecified, textBaselin
e: unspecified, fontFamily: unspecified, fontSize: 12.0, letterSpacing: unspecified, wordSpacing: unspecified, height: 123.0x)'
);
ui
.
TextStyle
ts2
=
s2
.
textStyle
;
expect
(
ts2
,
equals
(
new
ui
.
TextStyle
(
color:
const
Color
(
0xFF00FF00
),
fontWeight:
FontWeight
.
w800
,
fontSize:
10.0
,
height:
100.0
)));
expect
(
ts2
.
toString
(),
'TextStyle(
2338|color: Color(0xff00ff00), decoration: unspecified, decorationColor: unspecified, decorationStyle: unspecified, fontWeight: FontWeight.w800, fontStyl
e: unspecified, fontFamily: unspecified, fontSize: 10.0, letterSpacing: unspecified, wordSpacing: unspecified, height: 100.0x)'
);
expect
(
ts2
.
toString
(),
'TextStyle(
color: Color(0xff00ff00), decoration: unspecified, decorationColor: unspecified, decorationStyle: unspecified, fontWeight: FontWeight.w800, fontStyle: unspecified, textBaselin
e: unspecified, fontFamily: unspecified, fontSize: 10.0, letterSpacing: unspecified, wordSpacing: unspecified, height: 100.0x)'
);
ui
.
ParagraphStyle
ps2
=
s2
.
getParagraphStyle
(
textAlign:
TextAlign
.
center
);
expect
(
ps2
,
equals
(
new
ui
.
ParagraphStyle
(
textAlign:
TextAlign
.
center
,
fontWeight:
FontWeight
.
w800
,
fontSize:
10.0
,
lineHeight:
100.0
)));
expect
(
ps2
.
toString
(),
'ParagraphStyle(textAlign: TextAlign.center,
textBaseline: unspecified,
fontWeight: FontWeight.w800, fontStyle: unspecified, fontFamily: unspecified, fontSize: 10.0, lineHeight: 100.0x)'
);
expect
(
ps2
.
toString
(),
'ParagraphStyle(textAlign: TextAlign.center, fontWeight: FontWeight.w800, fontStyle: unspecified, fontFamily: unspecified, fontSize: 10.0, lineHeight: 100.0x)'
);
ui
.
ParagraphStyle
ps5
=
s5
.
getParagraphStyle
();
expect
(
ps5
,
equals
(
new
ui
.
ParagraphStyle
(
fontWeight:
FontWeight
.
w700
,
fontSize:
12.0
,
lineHeight:
123.0
)));
expect
(
ps5
.
toString
(),
'ParagraphStyle(textAlign: unspecified,
textBaseline: unspecified,
fontWeight: FontWeight.w700, fontStyle: unspecified, fontFamily: unspecified, fontSize: 12.0, lineHeight: 123.0x)'
);
expect
(
ps5
.
toString
(),
'ParagraphStyle(textAlign: unspecified, fontWeight: FontWeight.w700, fontStyle: unspecified, fontFamily: unspecified, fontSize: 12.0, lineHeight: 123.0x)'
);
});
}
packages/flutter/test/widget/media_query_test.dart
View file @
179ea4a0
...
...
@@ -20,6 +20,6 @@ void main() {
)
);
expect
(
size
,
equals
(
ui
.
window
.
size
));
expect
(
size
,
equals
(
ui
.
window
.
physicalSize
/
ui
.
window
.
devicePixelRatio
));
});
}
packages/flutter_test/lib/src/binding.dart
View file @
179ea4a0
...
...
@@ -724,8 +724,8 @@ class TestViewConfiguration extends ViewConfiguration {
super
(
size:
size
);
static
Matrix4
_getMatrix
(
Size
size
,
double
devicePixelRatio
)
{
final
double
actualWidth
=
ui
.
window
.
size
.
width
*
devicePixelRatio
;
final
double
actualHeight
=
ui
.
window
.
size
.
height
*
devicePixelRatio
;
final
double
actualWidth
=
ui
.
window
.
physicalSize
.
width
;
final
double
actualHeight
=
ui
.
window
.
physicalSize
.
height
;
final
double
desiredWidth
=
size
.
width
;
final
double
desiredHeight
=
size
.
height
;
double
scale
,
shiftX
,
shiftY
;
...
...
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