]> Cypherpunks repositories - gostls13.git/commitdiff
image: another build fix regarding ColorImage.
authorNigel Tao <nigeltao@golang.org>
Tue, 12 Oct 2010 03:33:37 +0000 (14:33 +1100)
committerNigel Tao <nigeltao@golang.org>
Tue, 12 Oct 2010 03:33:37 +0000 (14:33 +1100)
R=adg
TBR=adg
CC=golang-dev
https://golang.org/cl/2449041

src/pkg/exp/4s/xs.go
src/pkg/image/names.go

index bc5c5248368db7b0be235f2384f80af027797885..0b4b29de373f7ccdb2727e4641e0ea6b350a99ad 100644 (file)
@@ -144,17 +144,17 @@ var txbits = [NCOL][32]byte{
        },
 }
 
-var txpix = [NCOL]image.ColorImage{
-       image.ColorImage{image.RGBAColor{0xFF, 0xFF, 0x00, 0xFF}}, /* yellow */
-       image.ColorImage{image.RGBAColor{0x00, 0xFF, 0xFF, 0xFF}}, /* cyan */
-       image.ColorImage{image.RGBAColor{0x00, 0xFF, 0x00, 0xFF}}, /* lime green */
-       image.ColorImage{image.RGBAColor{0x00, 0x5D, 0xBB, 0xFF}}, /* slate */
-       image.ColorImage{image.RGBAColor{0xFF, 0x00, 0x00, 0xFF}}, /* red */
-       image.ColorImage{image.RGBAColor{0x55, 0xAA, 0xAA, 0xFF}}, /* olive green */
-       image.ColorImage{image.RGBAColor{0x00, 0x00, 0xFF, 0xFF}}, /* blue */
-       image.ColorImage{image.RGBAColor{0xFF, 0x55, 0xAA, 0xFF}}, /* pink */
-       image.ColorImage{image.RGBAColor{0xFF, 0xAA, 0xFF, 0xFF}}, /* lavender */
-       image.ColorImage{image.RGBAColor{0xBB, 0x00, 0x5D, 0xFF}}, /* maroon */
+var txpix = [NCOL]image.Image{
+       image.NewColorImage(image.RGBAColor{0xFF, 0xFF, 0x00, 0xFF}), /* yellow */
+       image.NewColorImage(image.RGBAColor{0x00, 0xFF, 0xFF, 0xFF}), /* cyan */
+       image.NewColorImage(image.RGBAColor{0x00, 0xFF, 0x00, 0xFF}), /* lime green */
+       image.NewColorImage(image.RGBAColor{0x00, 0x5D, 0xBB, 0xFF}), /* slate */
+       image.NewColorImage(image.RGBAColor{0xFF, 0x00, 0x00, 0xFF}), /* red */
+       image.NewColorImage(image.RGBAColor{0x55, 0xAA, 0xAA, 0xFF}), /* olive green */
+       image.NewColorImage(image.RGBAColor{0x00, 0x00, 0xFF, 0xFF}), /* blue */
+       image.NewColorImage(image.RGBAColor{0xFF, 0x55, 0xAA, 0xFF}), /* pink */
+       image.NewColorImage(image.RGBAColor{0xFF, 0xAA, 0xFF, 0xFF}), /* lavender */
+       image.NewColorImage(image.RGBAColor{0xBB, 0x00, 0x5D, 0xFF}), /* maroon */
 }
 
 func movemouse() int {
@@ -735,7 +735,7 @@ func Play(pp []Piece, ctxt draw.Window) {
        N = len(pieces[0].d)
        initPieces()
        rand.Seed(int64(time.Nanoseconds() % (1e9 - 1)))
-       whitemask = image.ColorImage{image.AlphaColor{0x7F}}
+       whitemask = image.NewColorImage(image.AlphaColor{0x7F})
        tsleep = 50
        timerc = time.Tick(int64(tsleep/2) * 1e6)
        suspc = make(chan bool)
index a8de71b7f7d7b3eb28f4bb7dfa6c67db8b8a7735..6900ec9231aebec4bc5e1edce535d97f81bbb321 100644 (file)
@@ -6,13 +6,13 @@ package image
 
 var (
        // Black is an opaque black ColorImage.
-       Black = ColorImage{Gray16Color{0}}
+       Black = NewColorImage(Gray16Color{0})
        // White is an opaque white ColorImage.
-       White = ColorImage{Gray16Color{0xffff}}
+       White = NewColorImage(Gray16Color{0xffff})
        // Transparent is a fully transparent ColorImage.
-       Transparent = ColorImage{Alpha16Color{0}}
+       Transparent = NewColorImage(Alpha16Color{0})
        // Opaque is a fully opaque ColorImage.
-       Opaque = ColorImage{Alpha16Color{0xffff}}
+       Opaque = NewColorImage(Alpha16Color{0xffff})
 )
 
 // A ColorImage is a practically infinite-sized Image of uniform Color.