OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrTest_DEFINED | 8 #ifndef GrTest_DEFINED |
9 #define GrTest_DEFINED | 9 #define GrTest_DEFINED |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 /** TODO Please do not use this if you can avoid it. We are in the process of d
eleting it. | 22 /** TODO Please do not use this if you can avoid it. We are in the process of d
eleting it. |
23 Allows a test to temporarily draw to a GrDrawTarget owned by a GrContext. Te
sts that use this | 23 Allows a test to temporarily draw to a GrDrawTarget owned by a GrContext. Te
sts that use this |
24 should be careful not to mix using the GrDrawTarget directly and drawing via
SkCanvas or | 24 should be careful not to mix using the GrDrawTarget directly and drawing via
SkCanvas or |
25 GrContext. In the future this object may provide some guards to prevent this
. */ | 25 GrContext. In the future this object may provide some guards to prevent this
. */ |
26 class GrTestTarget { | 26 class GrTestTarget { |
27 public: | 27 public: |
28 GrTestTarget() {}; | 28 GrTestTarget() {}; |
29 | 29 |
30 void init(GrContext*, sk_sp<GrDrawContext>); | 30 void init(GrContext*, sk_sp<GrDrawContext>); |
31 | 31 |
32 GrDrawTarget* target() { return fDrawContext->getDrawTarget(); } | |
33 GrResourceProvider* resourceProvider() { return fContext->resourceProvider()
; } | 32 GrResourceProvider* resourceProvider() { return fContext->resourceProvider()
; } |
34 | 33 |
35 private: | 34 private: |
36 SkAutoTUnref<GrContext> fContext; | 35 SkAutoTUnref<GrContext> fContext; |
37 sk_sp<GrDrawContext> fDrawContext; | 36 sk_sp<GrDrawContext> fDrawContext; |
38 }; | 37 }; |
39 | 38 |
40 #endif | 39 #endif |
OLD | NEW |