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

Side by Side Diff: tests/RecordReplaceDrawTest.cpp

Issue 1107973004: Pull cache out of GrContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixpicturerenderer.cpp Created 5 years, 7 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/ReadWriteAlphaTest.cpp ('k') | tests/ResourceCacheTest.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 #include "Test.h"
9
8 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
9 11
10 #include "Test.h"
11
12 #include "GrContextFactory.h" 12 #include "GrContextFactory.h"
13 #include "GrLayerCache.h" 13 #include "GrLayerCache.h"
14 #include "GrRecordReplaceDraw.h" 14 #include "GrRecordReplaceDraw.h"
15 #include "RecordTestUtils.h" 15 #include "RecordTestUtils.h"
16 #include "SkBBHFactory.h" 16 #include "SkBBHFactory.h"
17 #include "SkPictureRecorder.h" 17 #include "SkPictureRecorder.h"
18 #include "SkRecordDraw.h" 18 #include "SkRecordDraw.h"
19 #include "SkRecorder.h" 19 #include "SkRecorder.h"
20 #include "SkUtils.h" 20 #include "SkUtils.h"
21 21
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 SkIRect::MakeWH(kWidth, kHeight), 117 SkIRect::MakeWH(kWidth, kHeight),
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 SkAutoTUnref<GrTexture> texture(context->createTexture(desc, false, NULL, 0) ); 127 SkAutoTUnref<GrTexture> texture(context->textureProvider()->createTexture(de sc,
128 false, NULL, 0));
128 layer->setTexture(texture, SkIRect::MakeWH(kWidth, kHeight)); 129 layer->setTexture(texture, SkIRect::MakeWH(kWidth, kHeight));
129 130
130 SkAutoTUnref<SkBBoxHierarchy> bbh; 131 SkAutoTUnref<SkBBoxHierarchy> bbh;
131 132
132 SkRecord rerecord; 133 SkRecord rerecord;
133 SkRecorder canvas(&rerecord, kWidth, kHeight); 134 SkRecorder canvas(&rerecord, kWidth, kHeight);
134 GrRecordReplaceDraw(pic, &canvas, layerCache, SkMatrix::I(), NULL/*callback* /); 135 GrRecordReplaceDraw(pic, &canvas, layerCache, SkMatrix::I(), NULL/*callback* /);
135 136
136 int recount = rerecord.count(); 137 int recount = rerecord.count();
137 REPORTER_ASSERT(r, 2 == recount || 4 == recount); 138 REPORTER_ASSERT(r, 2 == recount || 4 == recount);
(...skipping 20 matching lines...) Expand all
158 if (NULL == context) { 159 if (NULL == context) {
159 continue; 160 continue;
160 } 161 }
161 162
162 test_replacements(r, context, true); 163 test_replacements(r, context, true);
163 test_replacements(r, context, false); 164 test_replacements(r, context, false);
164 } 165 }
165 } 166 }
166 167
167 #endif 168 #endif
OLDNEW
« no previous file with comments | « tests/ReadWriteAlphaTest.cpp ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698