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-05-20 18:14:33 +00:00
|
|
|
#include "GrDrawContext.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.
|
|
|
|
Allows a test to temporarily draw to a GrDrawTarget owned by a GrContext. Tests that use this
|
2013-08-21 19:27:48 +00:00
|
|
|
should be careful not to mix using the GrDrawTarget directly and drawing via SkCanvas or
|
|
|
|
GrContext. In the future this object may provide some guards to prevent this. */
|
|
|
|
class GrTestTarget {
|
|
|
|
public:
|
2015-07-13 14:19:57 +00:00
|
|
|
GrTestTarget() {};
|
2013-08-21 19:27:48 +00:00
|
|
|
|
2016-05-20 18:14:33 +00:00
|
|
|
void init(GrContext*, sk_sp<GrDrawContext>);
|
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:
|
2015-11-13 21:42:55 +00:00
|
|
|
SkAutoTUnref<GrContext> fContext;
|
2016-05-20 18:14:33 +00:00
|
|
|
sk_sp<GrDrawContext> fDrawContext;
|
2013-08-21 19:27:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|