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

Side by Side Diff: tests/RecordReplaceDrawTest.cpp

Issue 1406013006: Update Layer Hoisting to store its atlas texture in the resource cache (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Android bug Created 5 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
« no previous file with comments | « tests/GpuLayerCacheTest.cpp ('k') | 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 * 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 #include "Test.h" 8 #include "Test.h"
9 9
10 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 SkMatrix::I(), key, 1, &paint); 118 SkMatrix::I(), key, 1, &paint);
119 119
120 GrSurfaceDesc desc; 120 GrSurfaceDesc desc;
121 desc.fConfig = kSkia8888_GrPixelConfig; 121 desc.fConfig = kSkia8888_GrPixelConfig;
122 desc.fFlags = kRenderTarget_GrSurfaceFlag; 122 desc.fFlags = kRenderTarget_GrSurfaceFlag;
123 desc.fWidth = kWidth; 123 desc.fWidth = kWidth;
124 desc.fHeight = kHeight; 124 desc.fHeight = kHeight;
125 desc.fSampleCnt = 0; 125 desc.fSampleCnt = 0;
126 126
127 texture.reset(context->textureProvider()->createTexture(desc, false, nul lptr, 0)); 127 texture.reset(context->textureProvider()->createTexture(desc, false, nul lptr, 0));
128 layer->setTexture(texture, SkIRect::MakeWH(kWidth, kHeight)); 128 layer->setTexture(texture, SkIRect::MakeWH(kWidth, kHeight), false);
129 } 129 }
130 130
131 SkRecord rerecord; 131 SkRecord rerecord;
132 SkRecorder canvas(&rerecord, kWidth, kHeight); 132 SkRecorder canvas(&rerecord, kWidth, kHeight);
133 GrRecordReplaceDraw(pic, &canvas, layerCache, SkMatrix::I(), nullptr/*callba ck*/); 133 GrRecordReplaceDraw(pic, &canvas, layerCache, SkMatrix::I(), nullptr/*callba ck*/);
134 134
135 int numLayers = count_instances_of_type<SkRecords::SaveLayer>(rerecord); 135 int numLayers = count_instances_of_type<SkRecords::SaveLayer>(rerecord);
136 if (doReplace) { 136 if (doReplace) {
137 REPORTER_ASSERT(r, 0 == numLayers); 137 REPORTER_ASSERT(r, 0 == numLayers);
138 } else { 138 } else {
(...skipping 11 matching lines...) Expand all
150 if (nullptr == context) { 150 if (nullptr == context) {
151 continue; 151 continue;
152 } 152 }
153 153
154 test_replacements(r, context, false); 154 test_replacements(r, context, false);
155 test_replacements(r, context, true); 155 test_replacements(r, context, true);
156 } 156 }
157 } 157 }
158 158
159 #endif 159 #endif
OLDNEW
« no previous file with comments | « tests/GpuLayerCacheTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698