Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: include/gpu/GrContext.h

Issue 459033002: Change GR_COMPRESS_ALPHA_MASK from compile-time flag to run-time flag (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move things around a bit Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 class GrVertexBuffer; 42 class GrVertexBuffer;
43 class GrVertexBufferAllocPool; 43 class GrVertexBufferAllocPool;
44 class GrStrokeInfo; 44 class GrStrokeInfo;
45 class GrSoftwarePathRenderer; 45 class GrSoftwarePathRenderer;
46 class SkStrokeRec; 46 class SkStrokeRec;
47 47
48 class SK_API GrContext : public SkRefCnt { 48 class SK_API GrContext : public SkRefCnt {
49 public: 49 public:
50 SK_DECLARE_INST_COUNT(GrContext) 50 SK_DECLARE_INST_COUNT(GrContext)
51 51
52 struct Options {
53 Options();
54
55 // EXPERIMENTAL
56 // May be removed in the future, or may become standard depending
57 // on the outcomes of a variety of internal tests.
58 bool fDrawPathToCompressedTexture;
59 };
60
52 /** 61 /**
53 * Creates a GrContext for a backend context. 62 * Creates a GrContext for a backend context.
54 */ 63 */
55 static GrContext* Create(GrBackend, GrBackendContext); 64 static GrContext* Create(GrBackend, GrBackendContext, const Options* opts = NULL);
56 65
57 virtual ~GrContext(); 66 virtual ~GrContext();
58 67
59 /** 68 /**
60 * The GrContext normally assumes that no outsider is setting state 69 * The GrContext normally assumes that no outsider is setting state
61 * 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
62 * 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
63 * be called frequently for good performance. 72 * be called frequently for good performance.
64 * 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
65 * context, either GL or D3D (possible in future). 74 * context, either GL or D3D (possible in future).
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 GrStencilBuffer* findStencilBuffer(int width, int height, int sampleCnt); 941 GrStencilBuffer* findStencilBuffer(int width, int height, int sampleCnt);
933 942
934 GrPathRenderer* getPathRenderer( 943 GrPathRenderer* getPathRenderer(
935 const SkPath& path, 944 const SkPath& path,
936 const SkStrokeRec& stroke, 945 const SkStrokeRec& stroke,
937 const GrDrawTarget* target, 946 const GrDrawTarget* target,
938 bool allowSW, 947 bool allowSW,
939 GrPathRendererChain::DrawType drawType = GrPathRendererChain ::kColor_DrawType, 948 GrPathRendererChain::DrawType drawType = GrPathRendererChain ::kColor_DrawType,
940 GrPathRendererChain::StencilSupport* stencilSupport = NULL); 949 GrPathRendererChain::StencilSupport* stencilSupport = NULL);
941 950
951 /**
952 * This returns true if the underlying graphics device and system is
953 * capable of drawing paths to compressed textures. This generally provides
954 * a speedup on mobile devices with advanced GPUs, but it only gets turned
955 * on when there is a clear speedup benefit.
956 */
robertphillips 2014/08/11 19:22:20 drawPathsToCompressedTextures ? compressCoverageMa
krajcevski 2014/08/11 20:01:33 Done.
957 bool supportsDrawPathToCompressedTexture() const;
958
942 #if GR_CACHE_STATS 959 #if GR_CACHE_STATS
943 void printCacheStats() const; 960 void printCacheStats() const;
944 #endif 961 #endif
945 962
946 private: 963 private:
947 // Used to indicate whether a draw should be performed immediately or queued in fDrawBuffer. 964 // Used to indicate whether a draw should be performed immediately or queued in fDrawBuffer.
948 enum BufferedDraw { 965 enum BufferedDraw {
949 kYes_BufferedDraw, 966 kYes_BufferedDraw,
950 kNo_BufferedDraw, 967 kNo_BufferedDraw,
951 }; 968 };
(...skipping 26 matching lines...) Expand all
978 int fPMToUPMConversion; 995 int fPMToUPMConversion;
979 int fUPMToPMConversion; 996 int fUPMToPMConversion;
980 997
981 struct CleanUpData { 998 struct CleanUpData {
982 PFCleanUpFunc fFunc; 999 PFCleanUpFunc fFunc;
983 void* fInfo; 1000 void* fInfo;
984 }; 1001 };
985 1002
986 SkTDArray<CleanUpData> fCleanUpData; 1003 SkTDArray<CleanUpData> fCleanUpData;
987 1004
988 int fMaxTextureSizeOverride; 1005 int fMaxTextureSizeOverride;
robertphillips 2014/08/11 19:22:20 Options fOptions; ?
krajcevski 2014/08/11 20:01:33 Done.
1006 bool fSupportsDrawPathToCompressed;
989 1007
990 GrContext(); // init must be called after the constructor. 1008 GrContext(); // init must be called after the constructor.
991 bool init(GrBackend, GrBackendContext); 1009 bool init(GrBackend, GrBackendContext, const Options& opts);
992 1010
993 void setupDrawBuffer(); 1011 void setupDrawBuffer();
994 1012
995 class AutoRestoreEffects; 1013 class AutoRestoreEffects;
996 class AutoCheckFlush; 1014 class AutoCheckFlush;
997 /// Sets the paint and returns the target to draw into. The paint can be NUL L in which case the 1015 /// Sets the paint and returns the target to draw into. The paint can be NUL L in which case the
998 /// draw state is left unmodified. 1016 /// draw state is left unmodified.
999 GrDrawTarget* prepareToDraw(const GrPaint*, BufferedDraw, AutoRestoreEffects *, AutoCheckFlush*); 1017 GrDrawTarget* prepareToDraw(const GrPaint*, BufferedDraw, AutoRestoreEffects *, AutoCheckFlush*);
1000 1018
1001 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path, 1019 void internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath& path,
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 } 1145 }
1128 1146
1129 GrTexture* texture() { return fTexture; } 1147 GrTexture* texture() { return fTexture; }
1130 1148
1131 private: 1149 private:
1132 GrContext* fContext; 1150 GrContext* fContext;
1133 GrTexture* fTexture; 1151 GrTexture* fTexture;
1134 }; 1152 };
1135 1153
1136 #endif 1154 #endif
OLDNEW
« no previous file with comments | « gyp/gpu.gyp ('k') | src/gpu/GrContext.cpp » ('j') | src/gpu/GrContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698