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

Side by Side Diff: tests/ResourceCacheTest.cpp

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/RecorderTest.cpp ('k') | tests/SkResourceCacheTest.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 here to ensure SK_SUPPORT_GPU is set correctly before it is examined. 8 // Include here to ensure SK_SUPPORT_GPU is set correctly before it is examined.
9 #include "SkTypes.h" 9 #include "SkTypes.h"
10 10
(...skipping 19 matching lines...) Expand all
30 static const int gHeight = 480; 30 static const int gHeight = 480;
31 31
32 //////////////////////////////////////////////////////////////////////////////// 32 ////////////////////////////////////////////////////////////////////////////////
33 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceCacheCache, reporter, context) { 33 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceCacheCache, reporter, context) {
34 GrSurfaceDesc desc; 34 GrSurfaceDesc desc;
35 desc.fConfig = kSkia8888_GrPixelConfig; 35 desc.fConfig = kSkia8888_GrPixelConfig;
36 desc.fFlags = kRenderTarget_GrSurfaceFlag; 36 desc.fFlags = kRenderTarget_GrSurfaceFlag;
37 desc.fWidth = gWidth; 37 desc.fWidth = gWidth;
38 desc.fHeight = gHeight; 38 desc.fHeight = gHeight;
39 SkImageInfo info = SkImageInfo::MakeN32Premul(gWidth, gHeight); 39 SkImageInfo info = SkImageInfo::MakeN32Premul(gWidth, gHeight);
40 SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(context, 40 auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info));
41 SkBudgeted::kNo, info));
42 SkCanvas* canvas = surface->getCanvas(); 41 SkCanvas* canvas = surface->getCanvas();
43 42
44 const SkIRect size = SkIRect::MakeWH(gWidth, gHeight); 43 const SkIRect size = SkIRect::MakeWH(gWidth, gHeight);
45 44
46 SkBitmap src; 45 SkBitmap src;
47 src.allocN32Pixels(size.width(), size.height()); 46 src.allocN32Pixels(size.width(), size.height());
48 src.eraseColor(SK_ColorBLACK); 47 src.eraseColor(SK_ColorBLACK);
49 size_t srcSize = src.getSize(); 48 size_t srcSize = src.getSize();
50 49
51 size_t initialCacheSize; 50 size_t initialCacheSize;
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 test_cache_chained_purge(reporter); 1308 test_cache_chained_purge(reporter);
1310 test_resource_size_changed(reporter); 1309 test_resource_size_changed(reporter);
1311 test_timestamp_wrap(reporter); 1310 test_timestamp_wrap(reporter);
1312 test_flush(reporter); 1311 test_flush(reporter);
1313 test_large_resource_count(reporter); 1312 test_large_resource_count(reporter);
1314 test_custom_data(reporter); 1313 test_custom_data(reporter);
1315 test_abandoned(reporter); 1314 test_abandoned(reporter);
1316 } 1315 }
1317 1316
1318 #endif 1317 #endif
OLDNEW
« no previous file with comments | « tests/RecorderTest.cpp ('k') | tests/SkResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698