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

Side by Side Diff: tests/DeferredCanvasTest.cpp

Issue 70463002: "Fix" another crash on valgrind bot (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Actually do it right this time Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "Test.h" 8 #include "Test.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 10, // width 696 10, // width
697 10, // height 697 10, // height
698 kPMColor_SkColorType, 698 kPMColor_SkColorType,
699 kPremul_SkAlphaType 699 kPremul_SkAlphaType
700 }; 700 };
701 SkSurface* surface; 701 SkSurface* surface;
702 bool useGpu = NULL != factory; 702 bool useGpu = NULL != factory;
703 #if SK_SUPPORT_GPU 703 #if SK_SUPPORT_GPU
704 if (useGpu) { 704 if (useGpu) {
705 GrContext* context = factory->get(GrContextFactory::kNative_GLContextTyp e); 705 GrContext* context = factory->get(GrContextFactory::kNative_GLContextTyp e);
706 if (NULL == context) {
707 return;
708 }
709
706 surface = SkSurface::NewRenderTarget(context, imageSpec); 710 surface = SkSurface::NewRenderTarget(context, imageSpec);
707 } else { 711 } else {
708 surface = SkSurface::NewRaster(imageSpec); 712 surface = SkSurface::NewRaster(imageSpec);
709 } 713 }
710 #else 714 #else
711 SkASSERT(!useGpu); 715 SkASSERT(!useGpu);
712 surface = SkSurface::NewRaster(imageSpec); 716 surface = SkSurface::NewRaster(imageSpec);
713 #endif 717 #endif
714 SkASSERT(NULL != surface); 718 SkASSERT(NULL != surface);
715 SkAutoTUnref<SkSurface> aur(surface); 719 SkAutoTUnref<SkSurface> aur(surface);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 TestDeferredCanvasSurface(reporter, NULL); 843 TestDeferredCanvasSurface(reporter, NULL);
840 TestDeferredCanvasSetSurface(reporter, NULL); 844 TestDeferredCanvasSetSurface(reporter, NULL);
841 if (NULL != factory) { 845 if (NULL != factory) {
842 TestDeferredCanvasSurface(reporter, factory); 846 TestDeferredCanvasSurface(reporter, factory);
843 TestDeferredCanvasSetSurface(reporter, factory); 847 TestDeferredCanvasSetSurface(reporter, factory);
844 } 848 }
845 } 849 }
846 850
847 #include "TestClassDef.h" 851 #include "TestClassDef.h"
848 DEFINE_GPUTESTCLASS("DeferredCanvas", TestDeferredCanvasClass, TestDeferredCanva s) 852 DEFINE_GPUTESTCLASS("DeferredCanvas", TestDeferredCanvasClass, TestDeferredCanva s)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698