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

Unified Diff: tests/GpuLayerCacheTest.cpp

Issue 388833003: Remove Skia's use of the default SkPicture constructor and multi-clone (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix test Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPictureData.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GpuLayerCacheTest.cpp
diff --git a/tests/GpuLayerCacheTest.cpp b/tests/GpuLayerCacheTest.cpp
index d6371e1657b84c36751b5d52f9200ab1dd3a9ca5..02917e475fe9fe5bc07cdc2ca361178e881baa20 100644
--- a/tests/GpuLayerCacheTest.cpp
+++ b/tests/GpuLayerCacheTest.cpp
@@ -10,6 +10,7 @@
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrLayerCache.h"
+#include "SkPictureRecorder.h"
#include "Test.h"
static const int kNumLayers = 5;
@@ -54,11 +55,13 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
return;
}
- SkPicture picture;
+ SkPictureRecorder recorder;
+ recorder.beginRecording(1, 1);
+ SkAutoTUnref<const SkPicture> picture(recorder.endRecording());
GrLayerCache cache(context);
- create_layers(reporter, &cache, picture);
+ create_layers(reporter, &cache, *picture);
// Lock the layers making them all 512x512
GrTextureDesc desc;
@@ -67,7 +70,7 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
desc.fConfig = kSkia8888_GrPixelConfig;
for (int i = 0; i < kNumLayers; ++i) {
- GrCachedLayer* layer = cache.findLayer(&picture, i);
+ GrCachedLayer* layer = cache.findLayer(picture, i);
REPORTER_ASSERT(reporter, NULL != layer);
bool foundInCache = cache.lock(layer, desc);
@@ -91,14 +94,14 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
// Unlock the textures
for (int i = 0; i < kNumLayers; ++i) {
- GrCachedLayer* layer = cache.findLayer(&picture, i);
+ GrCachedLayer* layer = cache.findLayer(picture, i);
REPORTER_ASSERT(reporter, NULL != layer);
cache.unlock(layer);
}
for (int i = 0; i < kNumLayers; ++i) {
- GrCachedLayer* layer = cache.findLayer(&picture, i);
+ GrCachedLayer* layer = cache.findLayer(picture, i);
REPORTER_ASSERT(reporter, NULL != layer);
#if USE_ATLAS
@@ -118,7 +121,7 @@ DEF_GPUTEST(GpuLayerCache, reporter, factory) {
// Free them all SkGpuDevice-style. This will not free up the
// atlas' texture but will eliminate all the layers.
- cache.purge(&picture);
+ cache.purge(picture);
REPORTER_ASSERT(reporter, GetNumLayers::NumLayers(&cache) == 0);
// TODO: add VRAM/resource cache check here
« no previous file with comments | « src/core/SkPictureData.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698