OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Test.h" | 8 #include "Test.h" |
9 #include "SkBitmapDevice.h" | 9 #include "SkBitmapDevice.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 }; | 290 }; |
291 | 291 |
292 struct CanvasConfig { | 292 struct CanvasConfig { |
293 DevType fDevType; | 293 DevType fDevType; |
294 bool fTightRowBytes; | 294 bool fTightRowBytes; |
295 }; | 295 }; |
296 | 296 |
297 static const CanvasConfig gCanvasConfigs[] = { | 297 static const CanvasConfig gCanvasConfigs[] = { |
298 {kRaster_DevType, true}, | 298 {kRaster_DevType, true}, |
299 {kRaster_DevType, false}, | 299 {kRaster_DevType, false}, |
300 #if SK_SUPPORT_GPU && defined(SK_SCALAR_IS_FLOAT) | 300 #if SK_SUPPORT_GPU |
301 {kGpu_BottomLeft_DevType, true}, // row bytes has no meaning on gpu devices | 301 {kGpu_BottomLeft_DevType, true}, // row bytes has no meaning on gpu devices |
302 {kGpu_TopLeft_DevType, true}, // row bytes has no meaning on gpu devices | 302 {kGpu_TopLeft_DevType, true}, // row bytes has no meaning on gpu devices |
303 #endif | 303 #endif |
304 }; | 304 }; |
305 | 305 |
306 static SkBaseDevice* createDevice(const CanvasConfig& c, GrContext* grCtx) { | 306 static SkBaseDevice* createDevice(const CanvasConfig& c, GrContext* grCtx) { |
307 switch (c.fDevType) { | 307 switch (c.fDevType) { |
308 case kRaster_DevType: { | 308 case kRaster_DevType: { |
309 SkBitmap bmp; | 309 SkBitmap bmp; |
310 size_t rowBytes = c.fTightRowBytes ? 0 : 4 * DEV_W + 100; | 310 size_t rowBytes = c.fTightRowBytes ? 0 : 4 * DEV_W + 100; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 REPORTER_ASSERT(reporter, intersects == (idBefore != idA
fter)); | 465 REPORTER_ASSERT(reporter, intersects == (idBefore != idA
fter)); |
466 } | 466 } |
467 } | 467 } |
468 } | 468 } |
469 } | 469 } |
470 } | 470 } |
471 } | 471 } |
472 | 472 |
473 #include "TestClassDef.h" | 473 #include "TestClassDef.h" |
474 DEFINE_GPUTESTCLASS("WritePixels", WritePixelsTestClass, WritePixelsTest) | 474 DEFINE_GPUTESTCLASS("WritePixels", WritePixelsTestClass, WritePixelsTest) |
OLD | NEW |