[go: nahoru, domu]

Updated DrawScope and ContentDrawScope
to extend from CanvasScope to access
the declarative graphics framework

Relnote: "Updated higher level
compose APIs that expose a Canvas to
expose CanvasScope instead. This removes
the need for consumers to maintain their
own Paint objects. For consumers that
still require access to a Canvas
they can use the drawCanvas extension
method which provides a callback to issue
drawing commands with the underlying
Canvas."

Bug: 154835459
Test: re-ran compose tests
Change-Id: I80afdf4c0a648962aa6ef1efc05b1d3b65757094
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/FirstDrawTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/FirstDrawTest.kt
index 015a77fb..fa112c6 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/FirstDrawTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/FirstDrawTest.kt
@@ -25,7 +25,7 @@
 import androidx.ui.core.Modifier
 import androidx.ui.core.setContent
 import androidx.ui.foundation.Box
-import androidx.ui.foundation.Canvas2
+import androidx.ui.foundation.Canvas
 import androidx.ui.graphics.Color
 import androidx.ui.layout.fillMaxSize
 import androidx.ui.test.android.AndroidComposeTestRule
@@ -46,7 +46,7 @@
     fun waitsForFirstDraw() {
         var drawn = false
         testRule.setContent {
-            Canvas2(Modifier.fillMaxSize()) {
+            Canvas(Modifier.fillMaxSize()) {
                 drawn = true
             }
         }
@@ -61,7 +61,7 @@
     fun waitsForFirstDraw_withoutOnIdle() {
         var drawn = false
         testRule.setContent {
-            Canvas2(Modifier.fillMaxSize()) {
+            Canvas(Modifier.fillMaxSize()) {
                 drawn = true
             }
         }
@@ -104,7 +104,7 @@
             outOfBoundsView.setContent(Recomposer.current()) {
                 // If you see this box when running the test, the test is setup incorrectly
                 Box(Modifier, backgroundColor = Color.Yellow)
-                Canvas2(Modifier) {
+                Canvas(Modifier) {
                     drawn = true
                 }
             }