michael@0: michael@0: /* michael@0: * Copyright 2013 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef GrTest_DEFINED michael@0: #define GrTest_DEFINED michael@0: michael@0: #include "GrContext.h" michael@0: #include "GrDrawTarget.h" michael@0: michael@0: /** Allows a test to temporarily draw to a GrDrawTarget owned by a GrContext. Tests that use this michael@0: should be careful not to mix using the GrDrawTarget directly and drawing via SkCanvas or michael@0: GrContext. In the future this object may provide some guards to prevent this. */ michael@0: class GrTestTarget { michael@0: public: michael@0: GrTestTarget() {}; michael@0: michael@0: void init(GrContext*, GrDrawTarget*); michael@0: michael@0: GrDrawTarget* target() { return fDrawTarget.get(); } michael@0: michael@0: private: michael@0: SkTLazy fASR; michael@0: SkTLazy fACR; michael@0: SkTLazy fAGP; michael@0: michael@0: SkAutoTUnref fDrawTarget; michael@0: SkAutoTUnref fContext; michael@0: }; michael@0: michael@0: #endif