Sanitizing source files in Housekeeper-Nightly

git-svn-id: http://skia.googlecode.com/svn/trunk@13871 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
skia.committer@gmail.com 2014-03-20 03:02:31 +00:00
parent a95a066f4a
commit be41d38f1c
7 changed files with 12 additions and 13 deletions

View File

@ -102,7 +102,7 @@
// no need to pass in the colortype to this function.
static inline uint32_t SkSwizzle_RB(uint32_t c) {
static const uint32_t kRBMask = (0xFF << SK_R32_SHIFT) | (0xFF << SK_B32_SHIFT);
unsigned c0 = (c >> SK_R32_SHIFT) & 0xFF;
unsigned c1 = (c >> SK_B32_SHIFT) & 0xFF;
return (c & ~kRBMask) | (c0 << SK_B32_SHIFT) | (c1 << SK_R32_SHIFT);

View File

@ -30,13 +30,13 @@ class GrTextContext;
class SK_API SkGpuDevice : public SkBitmapDevice {
public:
enum Flags {
kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear
kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear
kCached_Flag = 1 << 1, //!< Surface is cached and needs to be unlocked when released
};
/**
* Creates an SkGpuDevice from a GrSurface. This will fail if the surface is not a render
* target. The caller owns a ref on the returned device. If the surface is cached,
* target. The caller owns a ref on the returned device. If the surface is cached,
* the kCached_Flag should be specified to make the device responsible for unlocking
* the surface when it is released.
*/

View File

@ -13,7 +13,7 @@ template <bool doSwapRB, AlphaVerb doAlpha> uint32_t convert32(uint32_t c) {
if (doSwapRB) {
c = SkSwizzle_RB(c);
}
// Lucky for us, in both RGBA and BGRA, the alpha component is always in the same place, so
// we can perform premul or unpremul the same way without knowing the swizzles for RGB.
switch (doAlpha) {
@ -115,4 +115,3 @@ bool SkSrcPixelInfo::convertPixelsTo(SkDstPixelInfo* dst, int width, int height)
}
return true;
}

View File

@ -1411,13 +1411,13 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target,
dstPI.fAlphaType = kUnpremul_SkAlphaType;
dstPI.fPixels = buffer;
dstPI.fRowBytes = rowBytes;
SkSrcPixelInfo srcPI;
srcPI.fColorType = swapRAndB ? toggle_colortype32(dstPI.fColorType) : dstPI.fColorType;
srcPI.fAlphaType = kPremul_SkAlphaType;
srcPI.fPixels = buffer;
srcPI.fRowBytes = rowBytes;
return srcPI.convertPixelsTo(&dstPI, width, height);
}
return true;
@ -1556,7 +1556,7 @@ bool GrContext::writeRenderTargetPixels(GrRenderTarget* target,
if (!srcPI.convertPixelsTo(&dstPI, width, height)) {
return false;
}
buffer = tmpPixels.get();
rowBytes = 4 * width;
}

View File

@ -41,7 +41,7 @@ static void build_compressed_data(void* buffer, const SkBitmap& bitmap) {
dstPI.fAlphaType = kPremul_SkAlphaType;
dstPI.fPixels = buffer;
dstPI.fRowBytes = count * sizeof(SkPMColor);
SkSrcPixelInfo srcPI;
srcPI.fColorType = kPMColor_SkColorType;
srcPI.fAlphaType = kPremul_SkAlphaType;

View File

@ -324,13 +324,13 @@ static void TestSurfaceInCache(skiatest::Reporter* reporter,
REPORTER_ASSERT(reporter, expectedCachedResources == context->getGpuTextureCacheResourceCount());
// Verify that all the cached resources are locked in cache.
context->freeGpuResources();
context->freeGpuResources();
REPORTER_ASSERT(reporter, expectedCachedResources == context->getGpuTextureCacheResourceCount());
// Verify that all the cached resources are unlocked upon surface release
surface.reset(0);
context->freeGpuResources();
REPORTER_ASSERT(reporter, 0 == context->getGpuTextureCacheResourceCount());
REPORTER_ASSERT(reporter, 0 == context->getGpuTextureCacheResourceCount());
}
static void Test_crbug263329(skiatest::Reporter* reporter,

View File

@ -190,7 +190,7 @@ static bool checkWrite(skiatest::Reporter* reporter, SkCanvas* canvas, const SkB
SkImageInfo canvasInfo;
size_t canvasRowBytes;
const uint32_t* canvasPixels;
// Can't use canvas->peekPixels(), as we are trying to look at GPU pixels sometimes as well.
// At some point this will be unsupported, as we won't allow accessBitmap() to magically call
// readPixels for the client.
@ -441,7 +441,7 @@ DEF_GPUTEST(WritePixels, reporter, factory) {
for (size_t c = 0; c < SK_ARRAY_COUNT(gSrcConfigs); ++c) {
const SkColorType ct = gSrcConfigs[c].fColorType;
const SkAlphaType at = gSrcConfigs[c].fAlphaType;
fillCanvas(&canvas);
SkBitmap bmp;
REPORTER_ASSERT(reporter, setupBitmap(&bmp, ct, at, rect.width(),