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

Side by Side Diff: tests/GpuLayerCacheTest.cpp

Issue 803183003: Fix layer hoisting image filter corner cases (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix unit test Created 6 years 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 | « src/gpu/GrRecordReplaceDraw.cpp ('k') | tests/RecordReplaceDrawTest.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 2014 Google Inc. 2 * Copyright 2014 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 #if SK_SUPPORT_GPU 8 #if SK_SUPPORT_GPU
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 25 matching lines...) Expand all
36 GrLayerCache* cache, 36 GrLayerCache* cache,
37 const SkPicture& picture, 37 const SkPicture& picture,
38 unsigned numToAdd, 38 unsigned numToAdd,
39 unsigned idOffset) { 39 unsigned idOffset) {
40 40
41 for (unsigned i = 0; i < numToAdd; ++i) { 41 for (unsigned i = 0; i < numToAdd; ++i) {
42 unsigned indices[1] = { idOffset+i+1 }; 42 unsigned indices[1] = { idOffset+i+1 };
43 GrCachedLayer* layer = cache->findLayerOrCreate(picture.uniqueID(), 43 GrCachedLayer* layer = cache->findLayerOrCreate(picture.uniqueID(),
44 idOffset+i+1, idOffset+i +2, 44 idOffset+i+1, idOffset+i +2,
45 SkIRect::MakeEmpty(), 45 SkIRect::MakeEmpty(),
46 SkIRect::MakeEmpty(),
46 SkMatrix::I(), 47 SkMatrix::I(),
47 indices, 1, 48 indices, 1,
48 NULL); 49 NULL);
49 REPORTER_ASSERT(reporter, layer); 50 REPORTER_ASSERT(reporter, layer);
50 GrCachedLayer* temp = TestingAccess::Find(cache, picture.uniqueID(), SkM atrix::I(), 51 GrCachedLayer* temp = TestingAccess::Find(cache, picture.uniqueID(), SkM atrix::I(),
51 indices, 1); 52 indices, 1);
52 REPORTER_ASSERT(reporter, temp == layer); 53 REPORTER_ASSERT(reporter, temp == layer);
53 54
54 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(cache) == idOffset + i + 1); 55 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(cache) == idOffset + i + 1);
55 56
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 241
241 picture.reset(NULL); 242 picture.reset(NULL);
242 cache.processDeletedPictures(); 243 cache.processDeletedPictures();
243 244
244 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0); 245 REPORTER_ASSERT(reporter, TestingAccess::NumLayers(&cache) == 0);
245 // TODO: add VRAM/resource cache check here 246 // TODO: add VRAM/resource cache check here
246 } 247 }
247 } 248 }
248 249
249 #endif 250 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrRecordReplaceDraw.cpp ('k') | tests/RecordReplaceDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698