blob: 32676debae26c6480c85f78b1d79239785621362 [file] [log] [blame]
bsalomon@google.comc6980972011-11-02 19:57:21 +00001/*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
robertphillips@google.com73672252013-08-29 12:40:26 +00008#include "SkBitmapDevice.h"
bsalomon@google.comc6980972011-11-02 19:57:21 +00009#include "SkCanvas.h"
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000010#include "SkColorPriv.h"
reed@google.com4b163ed2012-08-07 21:35:13 +000011#include "SkMathPriv.h"
bsalomon@google.comc6980972011-11-02 19:57:21 +000012#include "SkRegion.h"
tfarina@chromium.org4ee16bf2014-01-10 22:08:27 +000013#include "Test.h"
tfarina@chromium.org4ee16bf2014-01-10 22:08:27 +000014
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000015#if SK_SUPPORT_GPU
bsalomon@google.comc6980972011-11-02 19:57:21 +000016#include "SkGpuDevice.h"
bsalomon@google.com67b915d2013-02-04 16:13:32 +000017#include "GrContextFactory.h"
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000018#endif
bsalomon@google.comc6980972011-11-02 19:57:21 +000019
bsalomon@google.comc6980972011-11-02 19:57:21 +000020static const int DEV_W = 100, DEV_H = 100;
21static const SkIRect DEV_RECT = SkIRect::MakeWH(DEV_W, DEV_H);
rmistry@google.comd6176b02012-08-23 18:14:13 +000022static const SkRect DEV_RECT_S = SkRect::MakeWH(DEV_W * SK_Scalar1,
bsalomon@google.comc6980972011-11-02 19:57:21 +000023 DEV_H * SK_Scalar1);
24
commit-bot@chromium.orgddf94cf2013-10-12 17:25:17 +000025static SkPMColor getCanvasColor(int x, int y) {
bsalomon@google.comc6980972011-11-02 19:57:21 +000026 SkASSERT(x >= 0 && x < DEV_W);
27 SkASSERT(y >= 0 && y < DEV_H);
bsalomon@google.com6850eab2011-11-03 20:29:47 +000028
29 U8CPU r = x;
30 U8CPU g = y;
31 U8CPU b = 0xc;
32
33 U8CPU a = 0xff;
bsalomon@google.comc4364992011-11-07 15:54:49 +000034 switch ((x+y) % 5) {
bsalomon@google.com6850eab2011-11-03 20:29:47 +000035 case 0:
36 a = 0xff;
37 break;
38 case 1:
39 a = 0x80;
40 break;
41 case 2:
42 a = 0xCC;
43 break;
44 case 4:
45 a = 0x01;
46 break;
47 case 3:
48 a = 0x00;
49 break;
50 }
51 return SkPremultiplyARGBInline(a, r, g, b);
bsalomon@google.comc6980972011-11-02 19:57:21 +000052}
rmistry@google.comd6176b02012-08-23 18:14:13 +000053
commit-bot@chromium.orgddf94cf2013-10-12 17:25:17 +000054static SkPMColor getBitmapColor(int x, int y, int w) {
bsalomon@google.comc6980972011-11-02 19:57:21 +000055 int n = y * w + x;
bsalomon@google.com6850eab2011-11-03 20:29:47 +000056
bsalomon@google.comc6980972011-11-02 19:57:21 +000057 U8CPU b = n & 0xff;
58 U8CPU g = (n >> 8) & 0xff;
59 U8CPU r = (n >> 16) & 0xff;
60 return SkPackARGB32(0xff, r, g , b);
61}
62
commit-bot@chromium.orgddf94cf2013-10-12 17:25:17 +000063static SkPMColor convertConfig8888ToPMColor(SkCanvas::Config8888 config8888,
64 uint32_t color,
65 bool* premul) {
bsalomon@google.com6850eab2011-11-03 20:29:47 +000066 const uint8_t* c = reinterpret_cast<uint8_t*>(&color);
67 U8CPU a,r,g,b;
bsalomon@google.comc4364992011-11-07 15:54:49 +000068 *premul = false;
bsalomon@google.com6850eab2011-11-03 20:29:47 +000069 switch (config8888) {
70 case SkCanvas::kNative_Premul_Config8888:
71 return color;
72 case SkCanvas::kNative_Unpremul_Config8888:
bsalomon@google.comc4364992011-11-07 15:54:49 +000073 *premul = true;
bsalomon@google.com6850eab2011-11-03 20:29:47 +000074 a = SkGetPackedA32(color);
75 r = SkGetPackedR32(color);
76 g = SkGetPackedG32(color);
77 b = SkGetPackedB32(color);
78 break;
79 case SkCanvas::kBGRA_Unpremul_Config8888:
bsalomon@google.comc4364992011-11-07 15:54:49 +000080 *premul = true; // fallthru
bsalomon@google.com6850eab2011-11-03 20:29:47 +000081 case SkCanvas::kBGRA_Premul_Config8888:
82 a = static_cast<U8CPU>(c[3]);
83 r = static_cast<U8CPU>(c[2]);
84 g = static_cast<U8CPU>(c[1]);
85 b = static_cast<U8CPU>(c[0]);
86 break;
87 case SkCanvas::kRGBA_Unpremul_Config8888:
bsalomon@google.comc4364992011-11-07 15:54:49 +000088 *premul = true; // fallthru
bsalomon@google.com6850eab2011-11-03 20:29:47 +000089 case SkCanvas::kRGBA_Premul_Config8888:
90 a = static_cast<U8CPU>(c[3]);
91 r = static_cast<U8CPU>(c[0]);
92 g = static_cast<U8CPU>(c[1]);
93 b = static_cast<U8CPU>(c[2]);
94 break;
bsalomon@google.comccaa0022012-09-25 19:55:07 +000095 default:
96 SkDEBUGFAIL("Unexpected Config8888");
97 return 0;
bsalomon@google.com6850eab2011-11-03 20:29:47 +000098 }
bsalomon@google.comc4364992011-11-07 15:54:49 +000099 if (*premul) {
bsalomon@google.com6850eab2011-11-03 20:29:47 +0000100 r = SkMulDiv255Ceiling(r, a);
101 g = SkMulDiv255Ceiling(g, a);
102 b = SkMulDiv255Ceiling(b, a);
103 }
104 return SkPackARGB32(a, r, g, b);
105}
106
commit-bot@chromium.orgddf94cf2013-10-12 17:25:17 +0000107static void fillCanvas(SkCanvas* canvas) {
bsalomon@google.comc6980972011-11-02 19:57:21 +0000108 static SkBitmap bmp;
109 if (bmp.isNull()) {
110 bmp.setConfig(SkBitmap::kARGB_8888_Config, DEV_W, DEV_H);
reed@google.com44a42ea2012-10-01 17:54:05 +0000111 SkDEBUGCODE(bool alloc =) bmp.allocPixels();
bsalomon@google.comc6980972011-11-02 19:57:21 +0000112 SkASSERT(alloc);
113 SkAutoLockPixels alp(bmp);
114 intptr_t pixels = reinterpret_cast<intptr_t>(bmp.getPixels());
115 for (int y = 0; y < DEV_H; ++y) {
116 for (int x = 0; x < DEV_W; ++x) {
117 SkPMColor* pixel = reinterpret_cast<SkPMColor*>(pixels + y * bmp.rowBytes() + x * bmp.bytesPerPixel());
118 *pixel = getCanvasColor(x, y);
119 }
120 }
121 }
122 canvas->save();
123 canvas->setMatrix(SkMatrix::I());
124 canvas->clipRect(DEV_RECT_S, SkRegion::kReplace_Op);
125 SkPaint paint;
126 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
127 canvas->drawBitmap(bmp, 0, 0, &paint);
128 canvas->restore();
129}
rmistry@google.comd6176b02012-08-23 18:14:13 +0000130
commit-bot@chromium.orgddf94cf2013-10-12 17:25:17 +0000131static void fillBitmap(SkBitmap* bitmap) {
bsalomon@google.comc6980972011-11-02 19:57:21 +0000132 SkASSERT(bitmap->lockPixelsAreWritable());
133 SkAutoLockPixels alp(*bitmap);
134 int w = bitmap->width();
135 int h = bitmap->height();
136 intptr_t pixels = reinterpret_cast<intptr_t>(bitmap->getPixels());
137 for (int y = 0; y < h; ++y) {
138 for (int x = 0; x < w; ++x) {
139 SkPMColor* pixel = reinterpret_cast<SkPMColor*>(pixels + y * bitmap->rowBytes() + x * bitmap->bytesPerPixel());
sugoi@google.com54f0d1b2013-02-27 19:17:41 +0000140 *pixel = getBitmapColor(x, y, w);
bsalomon@google.comc6980972011-11-02 19:57:21 +0000141 }
142 }
143}
144
commit-bot@chromium.orgddf94cf2013-10-12 17:25:17 +0000145static bool checkPixel(SkPMColor a, SkPMColor b, bool didPremulConversion) {
bsalomon@google.comc4364992011-11-07 15:54:49 +0000146 if (!didPremulConversion) {
147 return a == b;
148 }
149 int32_t aA = static_cast<int32_t>(SkGetPackedA32(a));
150 int32_t aR = static_cast<int32_t>(SkGetPackedR32(a));
151 int32_t aG = static_cast<int32_t>(SkGetPackedG32(a));
152 int32_t aB = SkGetPackedB32(a);
153
154 int32_t bA = static_cast<int32_t>(SkGetPackedA32(b));
155 int32_t bR = static_cast<int32_t>(SkGetPackedR32(b));
156 int32_t bG = static_cast<int32_t>(SkGetPackedG32(b));
157 int32_t bB = static_cast<int32_t>(SkGetPackedB32(b));
158
159 return aA == bA &&
160 SkAbs32(aR - bR) <= 1 &&
161 SkAbs32(aG - bG) <= 1 &&
162 SkAbs32(aB - bB) <= 1;
163}
164
bsalomon@google.comc6980972011-11-02 19:57:21 +0000165// checks the bitmap contains correct pixels after the readPixels
166// if the bitmap was prefilled with pixels it checks that these weren't
167// overwritten in the area outside the readPixels.
commit-bot@chromium.orgddf94cf2013-10-12 17:25:17 +0000168static bool checkRead(skiatest::Reporter* reporter,
169 const SkBitmap& bitmap,
170 int x, int y,
171 bool checkCanvasPixels,
172 bool checkBitmapPixels,
173 SkCanvas::Config8888 config8888) {
bsalomon@google.comc6980972011-11-02 19:57:21 +0000174 SkASSERT(SkBitmap::kARGB_8888_Config == bitmap.config());
175 SkASSERT(!bitmap.isNull());
bsalomon@google.com6850eab2011-11-03 20:29:47 +0000176 SkASSERT(checkCanvasPixels || checkBitmapPixels);
rmistry@google.comd6176b02012-08-23 18:14:13 +0000177
bsalomon@google.comc6980972011-11-02 19:57:21 +0000178 int bw = bitmap.width();
179 int bh = bitmap.height();
180
181 SkIRect srcRect = SkIRect::MakeXYWH(x, y, bw, bh);
182 SkIRect clippedSrcRect = DEV_RECT;
183 if (!clippedSrcRect.intersect(srcRect)) {
184 clippedSrcRect.setEmpty();
185 }
bsalomon@google.comc6980972011-11-02 19:57:21 +0000186 SkAutoLockPixels alp(bitmap);
187 intptr_t pixels = reinterpret_cast<intptr_t>(bitmap.getPixels());
188 for (int by = 0; by < bh; ++by) {
189 for (int bx = 0; bx < bw; ++bx) {
190 int devx = bx + srcRect.fLeft;
191 int devy = by + srcRect.fTop;
rmistry@google.comd6176b02012-08-23 18:14:13 +0000192
bsalomon@google.comc4364992011-11-07 15:54:49 +0000193 uint32_t pixel = *reinterpret_cast<SkPMColor*>(pixels + by * bitmap.rowBytes() + bx * bitmap.bytesPerPixel());
bsalomon@google.comc6980972011-11-02 19:57:21 +0000194
195 if (clippedSrcRect.contains(devx, devy)) {
bsalomon@google.com6850eab2011-11-03 20:29:47 +0000196 if (checkCanvasPixels) {
197 SkPMColor canvasPixel = getCanvasColor(devx, devy);
bsalomon@google.comc4364992011-11-07 15:54:49 +0000198 bool didPremul;
199 SkPMColor pmPixel = convertConfig8888ToPMColor(config8888, pixel, &didPremul);
200 bool check;
201 REPORTER_ASSERT(reporter, check = checkPixel(pmPixel, canvasPixel, didPremul));
202 if (!check) {
bsalomon@google.com72f3dca2012-08-17 13:32:06 +0000203 return false;
bsalomon@google.com6850eab2011-11-03 20:29:47 +0000204 }
bsalomon@google.comc6980972011-11-02 19:57:21 +0000205 }
bsalomon@google.com6850eab2011-11-03 20:29:47 +0000206 } else if (checkBitmapPixels) {
sugoi@google.com54f0d1b2013-02-27 19:17:41 +0000207 REPORTER_ASSERT(reporter, getBitmapColor(bx, by, bw) == pixel);
208 if (getBitmapColor(bx, by, bw) != pixel) {
bsalomon@google.com72f3dca2012-08-17 13:32:06 +0000209 return false;
bsalomon@google.comc6980972011-11-02 19:57:21 +0000210 }
211 }
212 }
213 }
bsalomon@google.com72f3dca2012-08-17 13:32:06 +0000214 return true;
bsalomon@google.comc6980972011-11-02 19:57:21 +0000215}
216
217enum BitmapInit {
218 kFirstBitmapInit = 0,
rmistry@google.comd6176b02012-08-23 18:14:13 +0000219
bsalomon@google.comc6980972011-11-02 19:57:21 +0000220 kNoPixels_BitmapInit = kFirstBitmapInit,
221 kTight_BitmapInit,
222 kRowBytes_BitmapInit,
rmistry@google.comd6176b02012-08-23 18:14:13 +0000223
bsalomon@google.comc6980972011-11-02 19:57:21 +0000224 kBitmapInitCnt
225};
226
commit-bot@chromium.orgddf94cf2013-10-12 17:25:17 +0000227static BitmapInit nextBMI(BitmapInit bmi) {
bsalomon@google.comc6980972011-11-02 19:57:21 +0000228 int x = bmi;
229 return static_cast<BitmapInit>(++x);
230}
231
commit-bot@chromium.orgddf94cf2013-10-12 17:25:17 +0000232static void init_bitmap(SkBitmap* bitmap, const SkIRect& rect, BitmapInit init) {
bsalomon@google.comc6980972011-11-02 19:57:21 +0000233 int w = rect.width();
234 int h = rect.height();
235 int rowBytes = 0;
236 bool alloc = true;
237 switch (init) {
238 case kNoPixels_BitmapInit:
239 alloc = false;
240 case kTight_BitmapInit:
241 break;
242 case kRowBytes_BitmapInit:
243 rowBytes = w * sizeof(SkPMColor) + 16 * sizeof(SkPMColor);
244 break;
245 default:
246 SkASSERT(0);
247 break;
248 }
249 bitmap->setConfig(SkBitmap::kARGB_8888_Config, w, h, rowBytes);
250 if (alloc) {
251 bitmap->allocPixels();
252 }
253}
254
tfarina@chromium.org4ee16bf2014-01-10 22:08:27 +0000255DEF_GPUTEST(ReadPixels, reporter, factory) {
bsalomon@google.comc6980972011-11-02 19:57:21 +0000256 const SkIRect testRects[] = {
257 // entire thing
258 DEV_RECT,
259 // larger on all sides
260 SkIRect::MakeLTRB(-10, -10, DEV_W + 10, DEV_H + 10),
261 // fully contained
262 SkIRect::MakeLTRB(DEV_W / 4, DEV_H / 4, 3 * DEV_W / 4, 3 * DEV_H / 4),
263 // outside top left
264 SkIRect::MakeLTRB(-10, -10, -1, -1),
265 // touching top left corner
266 SkIRect::MakeLTRB(-10, -10, 0, 0),
267 // overlapping top left corner
268 SkIRect::MakeLTRB(-10, -10, DEV_W / 4, DEV_H / 4),
269 // overlapping top left and top right corners
270 SkIRect::MakeLTRB(-10, -10, DEV_W + 10, DEV_H / 4),
271 // touching entire top edge
272 SkIRect::MakeLTRB(-10, -10, DEV_W + 10, 0),
273 // overlapping top right corner
274 SkIRect::MakeLTRB(3 * DEV_W / 4, -10, DEV_W + 10, DEV_H / 4),
275 // contained in x, overlapping top edge
276 SkIRect::MakeLTRB(DEV_W / 4, -10, 3 * DEV_W / 4, DEV_H / 4),
277 // outside top right corner
278 SkIRect::MakeLTRB(DEV_W + 1, -10, DEV_W + 10, -1),
279 // touching top right corner
280 SkIRect::MakeLTRB(DEV_W, -10, DEV_W + 10, 0),
281 // overlapping top left and bottom left corners
282 SkIRect::MakeLTRB(-10, -10, DEV_W / 4, DEV_H + 10),
283 // touching entire left edge
284 SkIRect::MakeLTRB(-10, -10, 0, DEV_H + 10),
285 // overlapping bottom left corner
286 SkIRect::MakeLTRB(-10, 3 * DEV_H / 4, DEV_W / 4, DEV_H + 10),
287 // contained in y, overlapping left edge
288 SkIRect::MakeLTRB(-10, DEV_H / 4, DEV_W / 4, 3 * DEV_H / 4),
289 // outside bottom left corner
290 SkIRect::MakeLTRB(-10, DEV_H + 1, -1, DEV_H + 10),
291 // touching bottom left corner
292 SkIRect::MakeLTRB(-10, DEV_H, 0, DEV_H + 10),
293 // overlapping bottom left and bottom right corners
294 SkIRect::MakeLTRB(-10, 3 * DEV_H / 4, DEV_W + 10, DEV_H + 10),
295 // touching entire left edge
296 SkIRect::MakeLTRB(0, DEV_H, DEV_W, DEV_H + 10),
297 // overlapping bottom right corner
298 SkIRect::MakeLTRB(3 * DEV_W / 4, 3 * DEV_H / 4, DEV_W + 10, DEV_H + 10),
299 // overlapping top right and bottom right corners
300 SkIRect::MakeLTRB(3 * DEV_W / 4, -10, DEV_W + 10, DEV_H + 10),
301 };
302
senorblanco@chromium.org3cb406b2013-02-05 19:50:46 +0000303 for (int dtype = 0; dtype < 3; ++dtype) {
bsalomon@google.com67b915d2013-02-04 16:13:32 +0000304 int glCtxTypeCnt = 1;
305#if SK_SUPPORT_GPU
306 if (0 != dtype) {
307 glCtxTypeCnt = GrContextFactory::kGLContextTypeCnt;
bsalomon@google.comc6980972011-11-02 19:57:21 +0000308 }
djsollen@google.com8688e5b2012-01-09 13:02:20 +0000309#endif
bsalomon@google.com67b915d2013-02-04 16:13:32 +0000310 for (int glCtxType = 0; glCtxType < glCtxTypeCnt; ++glCtxType) {
robertphillips@google.com1f2f3382013-08-29 11:54:56 +0000311 SkAutoTUnref<SkBaseDevice> device;
bsalomon@google.com67b915d2013-02-04 16:13:32 +0000312 if (0 == dtype) {
skia.committer@gmail.com772c4e62013-08-30 07:01:34 +0000313 device.reset(new SkBitmapDevice(SkBitmap::kARGB_8888_Config,
robertphillips@google.com1f2f3382013-08-29 11:54:56 +0000314 DEV_W, DEV_H, false));
bsalomon@google.com67b915d2013-02-04 16:13:32 +0000315 } else {
316#if SK_SUPPORT_GPU
317 GrContextFactory::GLContextType type =
318 static_cast<GrContextFactory::GLContextType>(glCtxType);
319 if (!GrContextFactory::IsRenderingGLContext(type)) {
320 continue;
bsalomon@google.comc6980972011-11-02 19:57:21 +0000321 }
bsalomon@google.com67b915d2013-02-04 16:13:32 +0000322 GrContext* context = factory->get(type);
323 if (NULL == context) {
324 continue;
325 }
senorblanco@chromium.org3cb406b2013-02-05 19:50:46 +0000326 GrTextureDesc desc;
327 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit;
328 desc.fWidth = DEV_W;
329 desc.fHeight = DEV_H;
bsalomon@google.comfec0bc32013-02-07 14:43:04 +0000330 desc.fConfig = kSkia8888_GrPixelConfig;
senorblanco@chromium.org3cb406b2013-02-05 19:50:46 +0000331 desc.fOrigin = 1 == dtype ? kBottomLeft_GrSurfaceOrigin
332 : kTopLeft_GrSurfaceOrigin;
333 GrAutoScratchTexture ast(context, desc, GrContext::kExact_ScratchTexMatch);
334 SkAutoTUnref<GrTexture> tex(ast.detach());
335 device.reset(new SkGpuDevice(context, tex));
bsalomon@google.com67b915d2013-02-04 16:13:32 +0000336#else
337 continue;
338#endif
339 }
340 SkCanvas canvas(device);
341 fillCanvas(&canvas);
342
343 static const SkCanvas::Config8888 gReadConfigs[] = {
344 SkCanvas::kNative_Premul_Config8888,
345 SkCanvas::kNative_Unpremul_Config8888,
commit-bot@chromium.org28621512013-08-07 19:43:45 +0000346
bsalomon@google.com67b915d2013-02-04 16:13:32 +0000347 SkCanvas::kBGRA_Premul_Config8888,
348 SkCanvas::kBGRA_Unpremul_Config8888,
commit-bot@chromium.org28621512013-08-07 19:43:45 +0000349
bsalomon@google.com67b915d2013-02-04 16:13:32 +0000350 SkCanvas::kRGBA_Premul_Config8888,
351 SkCanvas::kRGBA_Unpremul_Config8888,
352 };
353 for (size_t rect = 0; rect < SK_ARRAY_COUNT(testRects); ++rect) {
354 const SkIRect& srcRect = testRects[rect];
355 for (BitmapInit bmi = kFirstBitmapInit;
356 bmi < kBitmapInitCnt;
357 bmi = nextBMI(bmi)) {
358 for (size_t c = 0; c < SK_ARRAY_COUNT(gReadConfigs); ++c) {
359 SkCanvas::Config8888 config8888 = gReadConfigs[c];
360 SkBitmap bmp;
361 init_bitmap(&bmp, srcRect, bmi);
362
363 // if the bitmap has pixels allocated before the readPixels,
364 // note that and fill them with pattern
365 bool startsWithPixels = !bmp.isNull();
366 if (startsWithPixels) {
367 fillBitmap(&bmp);
368 }
369 uint32_t idBefore = canvas.getDevice()->accessBitmap(false).getGenerationID();
370 bool success =
371 canvas.readPixels(&bmp, srcRect.fLeft,
372 srcRect.fTop, config8888);
373 uint32_t idAfter = canvas.getDevice()->accessBitmap(false).getGenerationID();
374
375 // we expect to succeed when the read isn't fully clipped
376 // out.
377 bool expectSuccess = SkIRect::Intersects(srcRect, DEV_RECT);
378 // determine whether we expected the read to succeed.
379 REPORTER_ASSERT(reporter, success == expectSuccess);
380 // read pixels should never change the gen id
381 REPORTER_ASSERT(reporter, idBefore == idAfter);
382
383 if (success || startsWithPixels) {
384 checkRead(reporter, bmp, srcRect.fLeft, srcRect.fTop,
385 success, startsWithPixels, config8888);
386 } else {
387 // if we had no pixels beforehand and the readPixels
388 // failed then our bitmap should still not have pixels
389 REPORTER_ASSERT(reporter, bmp.isNull());
390 }
391 }
392 // check the old webkit version of readPixels that clips the
393 // bitmap size
394 SkBitmap wkbmp;
395 bool success = canvas.readPixels(srcRect, &wkbmp);
396 SkIRect clippedRect = DEV_RECT;
397 if (clippedRect.intersect(srcRect)) {
398 REPORTER_ASSERT(reporter, success);
399 checkRead(reporter, wkbmp, clippedRect.fLeft,
400 clippedRect.fTop, true, false,
401 SkCanvas::kNative_Premul_Config8888);
402 } else {
403 REPORTER_ASSERT(reporter, !success);
404 }
bsalomon@google.comc6980972011-11-02 19:57:21 +0000405 }
406 }
407 }
408 }
409}