From eece5f1fa57551f59c61f03767cafde7d05092f6 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 16 Nov 2018 12:15:47 -0800 Subject: [PATCH] Remove unused examples targets. These target are no longer built or referenced in either the Flutter or Fuchsia buildroots. Similar examples are present in the examples/ directory in the framework. --- examples/BUILD.gn | 11 ----- examples/hello_flutter/lib/main.dart | 50 --------------------- examples/hello_flutter/pubspec.yaml | 3 -- examples/spinning_square/lib/main.dart | 60 -------------------------- examples/spinning_square/pubspec.yaml | 3 -- 5 files changed, 127 deletions(-) delete mode 100644 examples/BUILD.gn delete mode 100644 examples/hello_flutter/lib/main.dart delete mode 100644 examples/hello_flutter/pubspec.yaml delete mode 100644 examples/spinning_square/lib/main.dart delete mode 100644 examples/spinning_square/pubspec.yaml diff --git a/examples/BUILD.gn b/examples/BUILD.gn deleted file mode 100644 index cf56dd887a170..0000000000000 --- a/examples/BUILD.gn +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright 2013 The Flutter Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -group("examples") { - deps = [ - "hello_flutter", - "hello_flutter:hello_flutter_aot", - "spinning_square", - ] -} diff --git a/examples/hello_flutter/lib/main.dart b/examples/hello_flutter/lib/main.dart deleted file mode 100644 index 7a0fd060b8e9f..0000000000000 --- a/examples/hello_flutter/lib/main.dart +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This example shows how to show the text 'Hello, world.' using the raw -// interface to the engine. - -import 'dart:ui' as ui; - -void beginFrame(Duration timeStamp) { - final double devicePixelRatio = ui.window.devicePixelRatio; - final ui.Size physicalSize = ui.window.physicalSize; - final ui.Size logicalSize = physicalSize / devicePixelRatio; - - final ui.ParagraphBuilder paragraphBuilder = new ui.ParagraphBuilder(new ui.ParagraphStyle()) - ..addText('Hello, world.'); - final ui.Paragraph paragraph = paragraphBuilder.build() - ..layout(new ui.ParagraphConstraints(width: logicalSize.width)); - - final ui.Rect physicalBounds = ui.Offset.zero & physicalSize; - final ui.PictureRecorder recorder = new ui.PictureRecorder(); - final ui.Canvas canvas = new ui.Canvas(recorder, physicalBounds); - canvas.scale(devicePixelRatio, devicePixelRatio); - canvas.drawRect(ui.Offset.zero & logicalSize, new ui.Paint()..color = const ui.Color(0xFF0000FF)); - canvas.drawParagraph(paragraph, new ui.Offset( - (logicalSize.width - paragraph.maxIntrinsicWidth) / 2.0, - (logicalSize.height - paragraph.height) / 2.0 - )); - final ui.Picture picture = recorder.endRecording(); - - 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) - ..addPicture(ui.Offset.zero, picture) - ..pop(); - - ui.window.render(sceneBuilder.build()); -} - -// This function is the primary entry point to your application. The engine -// calls main() as soon as it has loaded your code. -void main() { - // The engine calls onBeginFrame whenever it wants us to produce a frame. - ui.window.onBeginFrame = beginFrame; - // Here we kick off the whole process by asking the engine to schedule a new - // frame. The engine will eventually call onBeginFrame when it is time for us - // to actually produce the frame. - ui.window.scheduleFrame(); -} diff --git a/examples/hello_flutter/pubspec.yaml b/examples/hello_flutter/pubspec.yaml deleted file mode 100644 index 5e8ae01a4e1f8..0000000000000 --- a/examples/hello_flutter/pubspec.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright 2013 The Flutter Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. diff --git a/examples/spinning_square/lib/main.dart b/examples/spinning_square/lib/main.dart deleted file mode 100644 index c2d3a298b1ea4..0000000000000 --- a/examples/spinning_square/lib/main.dart +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This example shows how to perform a simple animation using the raw interface -// to the engine. - -import 'dart:math' as math; -import 'dart:typed_data'; -import 'dart:ui' as ui; - -void beginFrame(Duration timeStamp) { - // The timeStamp argument to beginFrame indicates the timing information we - // should use to clock our animations. It's important to use timeStamp rather - // than reading the system time because we want all the parts of the system to - // coordinate the timings of their animations. If each component read the - // system clock independently, the animations that we processed later would be - // slightly ahead of the animations we processed earlier. - - final double devicePixelRatio = ui.window.devicePixelRatio; - - // PAINT - final ui.Size logicalSize = ui.window.physicalSize / devicePixelRatio; - final ui.Rect paintBounds = ui.Offset.zero & logicalSize; - final ui.PictureRecorder recorder = new ui.PictureRecorder(); - final ui.Canvas canvas = new ui.Canvas(recorder, paintBounds); - canvas.translate(paintBounds.width / 2.0, paintBounds.height / 2.0); - - // Here we determine the rotation according to the timeStamp given to us by - // the engine. - final double t = timeStamp.inMicroseconds / Duration.MICROSECONDS_PER_MILLISECOND / 1800.0; - canvas.rotate(math.PI * (t % 1.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)); - final ui.Picture picture = recorder.endRecording(); - - // COMPOSITE - - final Float64List deviceTransform = new Float64List(16) - ..[0] = devicePixelRatio - ..[5] = devicePixelRatio - ..[10] = 1.0 - ..[15] = 1.0; - final ui.SceneBuilder sceneBuilder = new ui.SceneBuilder() - ..pushTransform(deviceTransform) - ..addPicture(ui.Offset.zero, picture) - ..pop(); - ui.window.render(sceneBuilder.build()); - - // After rendering the current frame of the animation, we ask the engine to - // schedule another frame. The engine will call beginFrame again when its time - // to produce the next frame. - ui.window.scheduleFrame(); -} - -void main() { - ui.window.onBeginFrame = beginFrame; - ui.window.scheduleFrame(); -} diff --git a/examples/spinning_square/pubspec.yaml b/examples/spinning_square/pubspec.yaml deleted file mode 100644 index 5e8ae01a4e1f8..0000000000000 --- a/examples/spinning_square/pubspec.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright 2013 The Flutter Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file.