diff options
author | 2011-02-01 22:56:16 +0000 | |
---|---|---|
committer | 2011-02-01 22:56:16 +0000 | |
commit | 0748f217ba21f764401757886cda3bdb395a360d (patch) | |
tree | 290b25d09723eddecc0681a44d72ae65a4965288 /gpu/include | |
parent | f7c157610ff85f7323f5e213b62478dcc66edbec (diff) |
Attempt to simplify NPOT texture caps. Also fixes case where textures would unnecessarily be bloated to POT. Adds setting of sampler's filter setting in paint conversion.
git-svn-id: http://skia.googlecode.com/svn/trunk@751 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/include')
-rw-r--r-- | gpu/include/GrGpu.h | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/gpu/include/GrGpu.h b/gpu/include/GrGpu.h index 5a9281e883..2bbb419e6f 100644 --- a/gpu/include/GrGpu.h +++ b/gpu/include/GrGpu.h @@ -55,28 +55,6 @@ public: static GrGpu* Create(Engine, Platform3DContext context3D); /** - * Describes levels of support for non-power-of-two textures. - */ - enum NPOTTextureTypes { - /** - * no support for NPOT textures - */ - kNone_NPOTTextureType, - /** - * only clamp is supported for textures - */ - kNoRepeat_NPOTTextureType, - /** - * no texture restrictions at all, but rendertargets must be POW2 - */ - kNonRendertarget_NPOTTextureType, - /** - * no POW2 restrictions at all - */ - kFull_NPOTTextureType - }; - - /** * Used to control the level of antialiasing available for a rendertarget. * Anti-alias quality levels depend on the underlying API/GPU capabilities. */ @@ -173,7 +151,10 @@ public: void unimpl(const char[]); /** - * Creates a texture object + * Creates a texture object. If desc width or height is not a power of + * two but underlying API requires a power of two texture then srcData + * will be embedded in a power of two texture. The extra width and height + * is filled as though srcData were rendered clamped into the texture. * * @param desc describes the texture to be created. * @param srcData texel data to load texture. Begins with full-size @@ -278,14 +259,25 @@ public: int minRenderTargetHeight() const { return fMinRenderTargetHeight; } /** - * Retrieves the level of NPOT texture support. Regardless of support level - * NPOT textures can always be created, but internally they may be imbedded - * in a POT texture. An exception is paletted textures which must be - * specified as a POT when npotTextureSupport() is not Full. + * Returns true if NPOT textures can be created + * + * @return true if NPOT textures can be created + */ + bool npotTextureSupport() const { return fNPOTTextureSupport; } + + /** + * Returns true if NPOT textures can be repeat/mirror tiled. * - * @return the level of NPOT texture support. + * @return true if NPOT textures can be tiled */ - NPOTTextureTypes npotTextureSupport() const { return fNPOTTextureSupport; } + bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; } + + /** + * Returns true if a NPOT texture can be a rendertarget + * + * @return the true if NPOT texture/rendertarget can be created. + */ + bool npotRenderTargetSupport() const { return fNPOTRenderTargetSupport; } int maxTextureDimension() const { return fMaxTextureDimension; } @@ -374,8 +366,10 @@ protected: // defaults to false, subclass can set true to support palleted textures bool f8bitPaletteSupport; - // defaults to false, subclass can set higher support level - NPOTTextureTypes fNPOTTextureSupport; + // set by subclass + bool fNPOTTextureSupport; + bool fNPOTTextureTileSupport; + bool fNPOTRenderTargetSupport; // True if only one stencil pass is required to implement the winding path // fill rule. Subclass responsible for setting this value. |