Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Side by Side Diff: tests/SurfaceTest.cpp

Issue 227433009: Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/SerializationTest.cpp ('k') | tests/WritePixelsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkImageEncoder.h" 10 #include "SkImageEncoder.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 SkAutoTUnref<SkImage> image(createImage(gRec[i].fType, NULL, color)); 144 SkAutoTUnref<SkImage> image(createImage(gRec[i].fType, NULL, color));
145 if (!image.get()) { 145 if (!image.get()) {
146 continue; // gpu may not be enabled 146 continue; // gpu may not be enabled
147 } 147 }
148 const void* addr = image->peekPixels(&info, &rowBytes); 148 const void* addr = image->peekPixels(&info, &rowBytes);
149 bool success = (NULL != addr); 149 bool success = (NULL != addr);
150 REPORTER_ASSERT(reporter, gRec[i].fPeekShouldSucceed == success); 150 REPORTER_ASSERT(reporter, gRec[i].fPeekShouldSucceed == success);
151 if (success) { 151 if (success) {
152 REPORTER_ASSERT(reporter, 10 == info.fWidth); 152 REPORTER_ASSERT(reporter, 10 == info.fWidth);
153 REPORTER_ASSERT(reporter, 10 == info.fHeight); 153 REPORTER_ASSERT(reporter, 10 == info.fHeight);
154 REPORTER_ASSERT(reporter, kPMColor_SkColorType == info.fColorType); 154 REPORTER_ASSERT(reporter, kN32_SkColorType == info.fColorType);
155 REPORTER_ASSERT(reporter, kPremul_SkAlphaType == info.fAlphaType || 155 REPORTER_ASSERT(reporter, kPremul_SkAlphaType == info.fAlphaType ||
156 kOpaque_SkAlphaType == info.fAlphaType); 156 kOpaque_SkAlphaType == info.fAlphaType);
157 REPORTER_ASSERT(reporter, info.minRowBytes() <= rowBytes); 157 REPORTER_ASSERT(reporter, info.minRowBytes() <= rowBytes);
158 REPORTER_ASSERT(reporter, pmcolor == *(const SkPMColor*)addr); 158 REPORTER_ASSERT(reporter, pmcolor == *(const SkPMColor*)addr);
159 } 159 }
160 } 160 }
161 } 161 }
162 162
163 static void test_canvaspeek(skiatest::Reporter* reporter, 163 static void test_canvaspeek(skiatest::Reporter* reporter,
164 GrContextFactory* factory) { 164 GrContextFactory* factory) {
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kDiscard_ContentChangeMode); 447 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kDiscard_ContentChangeMode);
448 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kDiscard_ContentChangeMode); 448 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kDiscard_ContentChangeMode);
449 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kRetain_ContentChangeMode); 449 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kRetain_ContentChangeMode);
450 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kRetain_ContentChangeMode); 450 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kRetain_ContentChangeMode);
451 TestGetTexture(reporter, kGpu_SurfaceType, context); 451 TestGetTexture(reporter, kGpu_SurfaceType, context);
452 TestGetTexture(reporter, kGpuScratch_SurfaceType, context); 452 TestGetTexture(reporter, kGpuScratch_SurfaceType, context);
453 } 453 }
454 } 454 }
455 #endif 455 #endif
456 } 456 }
OLDNEW
« no previous file with comments | « tests/SerializationTest.cpp ('k') | tests/WritePixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698