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

Side by Side Diff: tests/SurfaceTest.cpp

Issue 319043005: Support using OpenGL ES context on desktop (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 { kGpu_SurfaceType, false }, 161 { kGpu_SurfaceType, false },
162 { kGpuScratch_SurfaceType, false }, 162 { kGpuScratch_SurfaceType, false },
163 #endif 163 #endif
164 }; 164 };
165 165
166 const SkColor color = SK_ColorRED; 166 const SkColor color = SK_ColorRED;
167 const SkPMColor pmcolor = SkPreMultiplyColor(color); 167 const SkPMColor pmcolor = SkPreMultiplyColor(color);
168 168
169 GrContext* context = NULL; 169 GrContext* context = NULL;
170 #if SK_SUPPORT_GPU 170 #if SK_SUPPORT_GPU
171 context = factory->get(GrContextFactory::kNative_GLContextType); 171 context = factory->get(GrContextFactory::kNative_GLContextType, kNone_GrGLSt andard);
172 #endif 172 #endif
173 173
174 for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) { 174 for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) {
175 SkImageInfo info, requestInfo; 175 SkImageInfo info, requestInfo;
176 size_t rowBytes; 176 size_t rowBytes;
177 177
178 SkAutoTUnref<SkSurface> surface(createSurface(gRec[i].fType, context, 178 SkAutoTUnref<SkSurface> surface(createSurface(gRec[i].fType, context,
179 &requestInfo)); 179 &requestInfo));
180 surface->getCanvas()->clear(color); 180 surface->getCanvas()->clear(color);
181 181
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 TestSurfaceCopyOnWrite(reporter, kRaster_SurfaceType, NULL); 417 TestSurfaceCopyOnWrite(reporter, kRaster_SurfaceType, NULL);
418 TestSurfaceWritableAfterSnapshotRelease(reporter, kRaster_SurfaceType, NULL) ; 418 TestSurfaceWritableAfterSnapshotRelease(reporter, kRaster_SurfaceType, NULL) ;
419 TestSurfaceNoCanvas(reporter, kRaster_SurfaceType, NULL, SkSurface::kDiscard _ContentChangeMode); 419 TestSurfaceNoCanvas(reporter, kRaster_SurfaceType, NULL, SkSurface::kDiscard _ContentChangeMode);
420 TestSurfaceNoCanvas(reporter, kRaster_SurfaceType, NULL, SkSurface::kRetain_ ContentChangeMode); 420 TestSurfaceNoCanvas(reporter, kRaster_SurfaceType, NULL, SkSurface::kRetain_ ContentChangeMode);
421 421
422 test_imagepeek(reporter); 422 test_imagepeek(reporter);
423 test_canvaspeek(reporter, factory); 423 test_canvaspeek(reporter, factory);
424 424
425 #if SK_SUPPORT_GPU 425 #if SK_SUPPORT_GPU
426 TestGetTexture(reporter, kRaster_SurfaceType, NULL); 426 TestGetTexture(reporter, kRaster_SurfaceType, NULL);
427 if (NULL != factory) { 427 if (NULL != factory) {
robertphillips 2014/06/09 14:31:05 nit: overlength
Kimmo Kinnunen 2014/06/16 12:36:40 Done.
428 GrContext* context = factory->get(GrContextFactory::kNative_GLContextTyp e); 428 GrContext* context = factory->get(GrContextFactory::kNative_GLContextTyp e, kNone_GrGLStandard);
429 if (NULL != context) { 429 if (NULL != context) {
430 TestSurfaceInCache(reporter, kGpu_SurfaceType, context); 430 TestSurfaceInCache(reporter, kGpu_SurfaceType, context);
431 TestSurfaceInCache(reporter, kGpuScratch_SurfaceType, context); 431 TestSurfaceInCache(reporter, kGpuScratch_SurfaceType, context);
432 Test_crbug263329(reporter, kGpu_SurfaceType, context); 432 Test_crbug263329(reporter, kGpu_SurfaceType, context);
433 Test_crbug263329(reporter, kGpuScratch_SurfaceType, context); 433 Test_crbug263329(reporter, kGpuScratch_SurfaceType, context);
434 TestSurfaceCopyOnWrite(reporter, kGpu_SurfaceType, context); 434 TestSurfaceCopyOnWrite(reporter, kGpu_SurfaceType, context);
435 TestSurfaceCopyOnWrite(reporter, kGpuScratch_SurfaceType, context); 435 TestSurfaceCopyOnWrite(reporter, kGpuScratch_SurfaceType, context);
436 TestSurfaceWritableAfterSnapshotRelease(reporter, kGpu_SurfaceType, context); 436 TestSurfaceWritableAfterSnapshotRelease(reporter, kGpu_SurfaceType, context);
437 TestSurfaceWritableAfterSnapshotRelease(reporter, kGpuScratch_Surfac eType, context); 437 TestSurfaceWritableAfterSnapshotRelease(reporter, kGpuScratch_Surfac eType, context);
438 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kDiscard_ContentChangeMode); 438 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kDiscard_ContentChangeMode);
439 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kDiscard_ContentChangeMode); 439 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kDiscard_ContentChangeMode);
440 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kRetain_ContentChangeMode); 440 TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface:: kRetain_ContentChangeMode);
441 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kRetain_ContentChangeMode); 441 TestSurfaceNoCanvas(reporter, kGpuScratch_SurfaceType, context, SkSu rface::kRetain_ContentChangeMode);
442 TestGetTexture(reporter, kGpu_SurfaceType, context); 442 TestGetTexture(reporter, kGpu_SurfaceType, context);
443 TestGetTexture(reporter, kGpuScratch_SurfaceType, context); 443 TestGetTexture(reporter, kGpuScratch_SurfaceType, context);
444 } 444 }
445 } 445 }
446 #endif 446 #endif
447 } 447 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698