OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // May be removed in the future, or may become standard depending | 56 // May be removed in the future, or may become standard depending |
57 // on the outcomes of a variety of internal tests. | 57 // on the outcomes of a variety of internal tests. |
58 bool fDrawPathToCompressedTexture; | 58 bool fDrawPathToCompressedTexture; |
59 }; | 59 }; |
60 | 60 |
61 /** | 61 /** |
62 * Creates a GrContext for a backend context. | 62 * Creates a GrContext for a backend context. |
63 */ | 63 */ |
64 static GrContext* Create(GrBackend, GrBackendContext, const Options* opts =
NULL); | 64 static GrContext* Create(GrBackend, GrBackendContext, const Options* opts =
NULL); |
65 | 65 |
66 /** | |
67 * Only defined in test apps. | |
68 */ | |
69 static GrContext* CreateMockContext(); | |
70 | |
71 virtual ~GrContext(); | 66 virtual ~GrContext(); |
72 | 67 |
73 /** | 68 /** |
74 * The GrContext normally assumes that no outsider is setting state | 69 * The GrContext normally assumes that no outsider is setting state |
75 * within the underlying 3D API's context/device/whatever. This call informs | 70 * within the underlying 3D API's context/device/whatever. This call informs |
76 * the context that the state was modified and it should resend. Shouldn't | 71 * the context that the state was modified and it should resend. Shouldn't |
77 * be called frequently for good performance. | 72 * be called frequently for good performance. |
78 * The flag bits, state, is dpendent on which backend is used by the | 73 * The flag bits, state, is dpendent on which backend is used by the |
79 * context, either GL or D3D (possible in future). | 74 * context, either GL or D3D (possible in future). |
80 */ | 75 */ |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 }; | 971 }; |
977 | 972 |
978 SkTDArray<CleanUpData> fCleanUpData; | 973 SkTDArray<CleanUpData> fCleanUpData; |
979 | 974 |
980 int fMaxTextureSizeOverride; | 975 int fMaxTextureSizeOverride; |
981 | 976 |
982 const Options fOptions; | 977 const Options fOptions; |
983 | 978 |
984 GrContext(const Options&); // init must be called after the constructor. | 979 GrContext(const Options&); // init must be called after the constructor. |
985 bool init(GrBackend, GrBackendContext); | 980 bool init(GrBackend, GrBackendContext); |
986 void initMockContext(); | |
987 void initCommon(); | |
988 | 981 |
989 void setupDrawBuffer(); | 982 void setupDrawBuffer(); |
990 | 983 |
991 class AutoRestoreEffects; | 984 class AutoRestoreEffects; |
992 class AutoCheckFlush; | 985 class AutoCheckFlush; |
993 /// Sets the paint and returns the target to draw into. The paint can be NUL
L in which case the | 986 /// Sets the paint and returns the target to draw into. The paint can be NUL
L in which case the |
994 /// draw state is left unmodified. | 987 /// draw state is left unmodified. |
995 GrDrawTarget* prepareToDraw(const GrPaint*, AutoRestoreEffects*, AutoCheckFl
ush*); | 988 GrDrawTarget* prepareToDraw(const GrPaint*, AutoRestoreEffects*, AutoCheckFl
ush*); |
996 | 989 |
997 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path, | 990 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path, |
(...skipping 18 matching lines...) Expand all Loading... |
1016 /** | 1009 /** |
1017 * This callback allows the resource cache to callback into the GrContext | 1010 * This callback allows the resource cache to callback into the GrContext |
1018 * when the cache is still overbudget after a purge. | 1011 * when the cache is still overbudget after a purge. |
1019 */ | 1012 */ |
1020 static bool OverbudgetCB(void* data); | 1013 static bool OverbudgetCB(void* data); |
1021 | 1014 |
1022 typedef SkRefCnt INHERITED; | 1015 typedef SkRefCnt INHERITED; |
1023 }; | 1016 }; |
1024 | 1017 |
1025 #endif | 1018 #endif |
OLD | NEW |