2013-08-21 19:27:48 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2013 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GrTest_DEFINED
|
|
|
|
#define GrTest_DEFINED
|
|
|
|
|
|
|
|
#include "GrContext.h"
|
2016-10-27 18:47:55 +00:00
|
|
|
#include "GrRenderTargetContext.h"
|
2013-08-21 19:27:48 +00:00
|
|
|
|
2015-08-21 18:08:00 +00:00
|
|
|
namespace GrTest {
|
|
|
|
/**
|
|
|
|
* Forces the GrContext to use a small atlas which only has room for one plot and will thus
|
|
|
|
* constantly be evicting entries
|
|
|
|
*/
|
|
|
|
void SetupAlwaysEvictAtlas(GrContext*);
|
|
|
|
};
|
|
|
|
|
2016-01-13 18:08:27 +00:00
|
|
|
/** TODO Please do not use this if you can avoid it. We are in the process of deleting it.
|
2016-10-25 18:20:06 +00:00
|
|
|
Allows a test to temporarily draw to a GrOpList owned by a GrContext. Tests that use this
|
|
|
|
should be careful not to mix using the GrOpList directly and drawing via SkCanvas or
|
2013-08-21 19:27:48 +00:00
|
|
|
GrContext. In the future this object may provide some guards to prevent this. */
|
|
|
|
class GrTestTarget {
|
|
|
|
public:
|
2016-09-27 13:34:10 +00:00
|
|
|
GrTestTarget() {}
|
2013-08-21 19:27:48 +00:00
|
|
|
|
2016-10-27 18:47:55 +00:00
|
|
|
void init(GrContext*, sk_sp<GrRenderTargetContext>);
|
2013-08-21 19:27:48 +00:00
|
|
|
|
2015-07-31 13:48:27 +00:00
|
|
|
GrResourceProvider* resourceProvider() { return fContext->resourceProvider(); }
|
2013-08-21 19:27:48 +00:00
|
|
|
|
|
|
|
private:
|
2016-11-03 20:26:13 +00:00
|
|
|
sk_sp<GrContext> fContext;
|
|
|
|
sk_sp<GrRenderTargetContext> fRenderTargetContext;
|
2013-08-21 19:27:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|