initialize fFlags in bitmapprocshader



git-svn-id: http://skia.googlecode.com/svn/trunk@191 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@android.com 2009-05-29 21:30:42 +00:00
Родитель 25fc5b9f0a
Коммит 89bb83abb4
5 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -379,7 +379,7 @@ public:
@return true if the copy could be made. @return true if the copy could be made.
*/ */
bool copyTo(SkBitmap* dst, Config c, Allocator* allocator = NULL) const; bool copyTo(SkBitmap* dst, Config c, Allocator* allocator = NULL) const;
/** Returns true if this bitmap can be deep copied into the requested config /** Returns true if this bitmap can be deep copied into the requested config
by calling copyTo(). by calling copyTo().
*/ */

Просмотреть файл

@ -17,7 +17,7 @@ public:
shape's matrix (if any). shape's matrix (if any).
*/ */
void drawXY(SkCanvas*, SkScalar dx, SkScalar dy); void drawXY(SkCanvas*, SkScalar dx, SkScalar dy);
/** Draw the shape with the specified matrix, applied before the shape's /** Draw the shape with the specified matrix, applied before the shape's
matrix (if any). matrix (if any).
*/ */

Просмотреть файл

@ -246,7 +246,7 @@ void SkBitmap::setConfig(Config c, int width, int height, int rowBytes) {
goto ERROR; goto ERROR;
} }
} }
fConfig = SkToU8(c); fConfig = SkToU8(c);
fWidth = width; fWidth = width;
fHeight = height; fHeight = height;
@ -927,7 +927,7 @@ void SkBitmap::buildMipMap(bool forceRebuild) {
default: default:
return; // don't build mipmaps for these configs return; // don't build mipmaps for these configs
} }
SkAutoLockPixels alp(*this); SkAutoLockPixels alp(*this);
if (!this->readyToDraw()) { if (!this->readyToDraw()) {
return; return;
@ -949,7 +949,7 @@ void SkBitmap::buildMipMap(bool forceRebuild) {
maxLevels += 1; maxLevels += 1;
} }
} }
// nothing to build // nothing to build
if (0 == maxLevels) { if (0 == maxLevels) {
return; return;

Просмотреть файл

@ -21,6 +21,7 @@ SkBitmapProcShader::SkBitmapProcShader(const SkBitmap& src,
fRawBitmap = src; fRawBitmap = src;
fState.fTileModeX = (uint8_t)tmx; fState.fTileModeX = (uint8_t)tmx;
fState.fTileModeY = (uint8_t)tmy; fState.fTileModeY = (uint8_t)tmy;
fFlags = 0; // computed in setContext
} }
SkBitmapProcShader::SkBitmapProcShader(SkFlattenableReadBuffer& buffer) SkBitmapProcShader::SkBitmapProcShader(SkFlattenableReadBuffer& buffer)
@ -28,6 +29,7 @@ SkBitmapProcShader::SkBitmapProcShader(SkFlattenableReadBuffer& buffer)
fRawBitmap.unflatten(buffer); fRawBitmap.unflatten(buffer);
fState.fTileModeX = buffer.readU8(); fState.fTileModeX = buffer.readU8();
fState.fTileModeY = buffer.readU8(); fState.fTileModeY = buffer.readU8();
fFlags = 0; // computed in setContext
} }
void SkBitmapProcShader::beginSession() { void SkBitmapProcShader::beginSession() {
@ -95,8 +97,7 @@ bool SkBitmapProcShader::setContext(const SkBitmap& device,
} }
// update fFlags // update fFlags
fFlags = 0; // this should happen in SkShader.cpp fFlags = 0;
if (bitmapIsOpaque && (255 == this->getPaintAlpha())) { if (bitmapIsOpaque && (255 == this->getPaintAlpha())) {
fFlags |= kOpaqueAlpha_Flag; fFlags |= kOpaqueAlpha_Flag;
} }

Просмотреть файл

@ -35,7 +35,8 @@ SkColorTable::SkColorTable(int count)
SkDEBUGCODE(f16BitCacheLockCount = 0;) SkDEBUGCODE(f16BitCacheLockCount = 0;)
} }
SkColorTable::SkColorTable(const SkColorTable& src) { // call SkRefCnt's constructor explicitly, to avoid warning
SkColorTable::SkColorTable(const SkColorTable& src) : SkRefCnt() {
f16BitCache = NULL; f16BitCache = NULL;
fFlags = src.fFlags; fFlags = src.fFlags;
int count = src.count(); int count = src.count();