зеркало из https://github.com/mozilla/moz-skia.git
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
This commit is contained in:
Родитель
659988168a
Коммит
f9dae780c2
|
@ -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';
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -150,13 +150,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.
|
||||
*/
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -125,7 +125,7 @@ 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче