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"
|
|
|
|
#include "GrDrawTarget.h"
|
2015-06-26 04:29:25 +00:00
|
|
|
#include "gl/GrGLContext.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
|
|
|
|
2015-11-16 14:23:31 +00:00
|
|
|
void init(GrContext*, GrDrawTarget*, GrRenderTarget*);
|
2013-08-21 19:27:48 +00:00
|
|
|
|
|
|
|
GrDrawTarget* target() { return fDrawTarget.get(); }
|
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;
|
2015-11-16 14:23:31 +00:00
|
|
|
SkAutoTUnref<GrDrawTarget> fDrawTarget;
|
|
|
|
SkAutoTUnref<GrRenderTarget> fRenderTarget;
|
2013-08-21 19:27:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|