diff options
author | tfarina <tfarina@chromium.org> | 2014-06-06 06:35:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-06-06 06:35:28 -0700 |
commit | f9dae780c2c46a1f08adbbe8de2faaba091254d4 (patch) | |
tree | e27079a4a5947cbc10b6be9d85663728d7395bc3 | |
parent | 659988168a1a86ecf9c01c07f8345671769a0ccc (diff) |
Remove GrIsPow2 in favor of SkIsPow2.
Looks like there is no good reason to have two copies of this function
doing the same thing with different name.
BUG=None
TEST=make tests
R=bsalomon@google.com
Author: tfarina@chromium.org
Review URL: https://codereview.chromium.org/318873002
-rw-r--r-- | include/gpu/GrColor.h | 2 | ||||
-rw-r--r-- | include/gpu/GrTexture.h | 4 | ||||
-rw-r--r-- | include/gpu/GrTypes.h | 7 | ||||
-rw-r--r-- | src/gpu/GrContext.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrGpu.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrTexture.cpp | 2 |
6 files changed, 7 insertions, 14 deletions
diff --git a/include/gpu/GrColor.h b/include/gpu/GrColor.h index 9f6eb1cde2..1994cc5010 100644 --- a/include/gpu/GrColor.h +++ b/include/gpu/GrColor.h @@ -106,7 +106,7 @@ enum GrColorComponentFlags { }; static inline char GrColorComponentFlagToChar(GrColorComponentFlags component) { - SkASSERT(GrIsPow2(component)); + SkASSERT(SkIsPow2(component)); switch (component) { case kR_GrColorComponentFlag: return 'r'; diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h index 0f7fe9ea2f..047bd18186 100644 --- a/include/gpu/GrTexture.h +++ b/include/gpu/GrTexture.h @@ -47,11 +47,11 @@ public: * new callsites for these functions. They are slated for removal. */ SkFixed normalizeFixedX(SkFixed x) const { - SkASSERT(GrIsPow2(fDesc.fWidth)); + SkASSERT(SkIsPow2(fDesc.fWidth)); return x >> fShiftFixedX; } SkFixed normalizeFixedY(SkFixed y) const { - SkASSERT(GrIsPow2(fDesc.fHeight)); + SkASSERT(SkIsPow2(fDesc.fHeight)); return y >> fShiftFixedY; } diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h index 34f4e2827d..519ad0fbca 100644 --- a/include/gpu/GrTypes.h +++ b/include/gpu/GrTypes.h @@ -151,13 +151,6 @@ static inline size_t GrSizeAlignDown(size_t x, uint32_t alignment) { /////////////////////////////////////////////////////////////////////////////// /** - * Return true if n is a power of 2 - */ -static inline bool GrIsPow2(unsigned n) { - return n && 0 == (n & (n - 1)); -} - -/** * Return the next power of 2 >= n. */ static inline uint32_t GrNextPow2(uint32_t n) { diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 66588c46bc..e8ae18a4e2 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -618,7 +618,7 @@ bool GrContext::supportsIndex8PixelConfig(const GrTextureParams* params, return false; } - bool isPow2 = GrIsPow2(width) && GrIsPow2(height); + bool isPow2 = SkIsPow2(width) && SkIsPow2(height); if (!isPow2) { bool tiled = NULL != params && params->isTiled(); diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index 36a9cf19b4..fd249deb7b 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -125,10 +125,10 @@ GrTexture* GrGpu::createTexture(const GrTextureDesc& desc, SkASSERT((desc.fFlags & kRenderTarget_GrTextureFlagBit) == 0); if (!this->caps()->npotTextureTileSupport() && - (!GrIsPow2(desc.fWidth) || !GrIsPow2(desc.fHeight))) { + (!SkIsPow2(desc.fWidth) || !SkIsPow2(desc.fHeight))) { return NULL; } - + this->handleDirtyContext(); tex = this->onCreateCompressedTexture(desc, srcData); } else { diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp index 20cd597fc4..4f95730b12 100644 --- a/src/gpu/GrTexture.cpp +++ b/src/gpu/GrTexture.cpp @@ -172,7 +172,7 @@ GrResourceKey::ResourceFlags get_texture_flags(const GrGpu* gpu, GrResourceKey::ResourceFlags flags = 0; bool tiled = NULL != params && params->isTiled(); if (tiled && !gpu->caps()->npotTextureTileSupport()) { - if (!GrIsPow2(desc.fWidth) || !GrIsPow2(desc.fHeight)) { + if (!SkIsPow2(desc.fWidth) || !SkIsPow2(desc.fHeight)) { flags |= kStretchToPOT_TextureFlag; switch(params->filterMode()) { case GrTextureParams::kNone_FilterMode: |