[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
zmo at google.com
zmo at google.com
Wed Dec 22 15:20:24 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 1b9e28b232e4c516c0db07b3d4d7b501850dfb43
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 1 17:35:56 2010 +0000
2010-10-28 Zhenyao Mo <zmo at google.com>
Reviewed by Kenneth Russell.
Fix enum naming style violation in GraphicsContext3D
https://bugs.webkit.org/show_bug.cgi?id=48441
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::extractImageData):
(WebCore::GraphicsContext3D::extractTextureData):
(WebCore::doPacking):
(WebCore::GraphicsContext3D::packPixels):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::getSourceDataFormat):
(WebCore::GraphicsContext3D::getImageData):
* platform/graphics/skia/GraphicsContext3DSkia.cpp:
(WebCore::GraphicsContext3D::getImageData):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71034 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2b4f2cd..377a9d1 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-10-28 Zhenyao Mo <zmo at google.com>
+
+ Reviewed by Kenneth Russell.
+
+ Fix enum naming style violation in GraphicsContext3D
+ https://bugs.webkit.org/show_bug.cgi?id=48441
+
+ * platform/graphics/GraphicsContext3D.cpp:
+ (WebCore::GraphicsContext3D::extractImageData):
+ (WebCore::GraphicsContext3D::extractTextureData):
+ (WebCore::doPacking):
+ (WebCore::GraphicsContext3D::packPixels):
+ * platform/graphics/GraphicsContext3D.h:
+ * platform/graphics/cg/GraphicsContext3DCG.cpp:
+ (WebCore::getSourceDataFormat):
+ (WebCore::GraphicsContext3D::getImageData):
+ * platform/graphics/skia/GraphicsContext3DSkia.cpp:
+ (WebCore::GraphicsContext3D::getImageData):
+
2010-11-01 Martin Robinson <mrobinson at igalia.com>
Reviewed by Xan Lopez.
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index b8c66d5..8b92376 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -132,13 +132,13 @@ bool GraphicsContext3D::extractImageData(ImageData* imageData,
int dataBytes = width * height * 4;
data.resize(dataBytes);
if (!packPixels(imageData->data()->data()->data(),
- kSourceFormatRGBA8,
+ SourceFormatRGBA8,
width,
height,
0,
format,
type,
- premultiplyAlpha ? kAlphaDoPremultiply : kAlphaDoNothing,
+ premultiplyAlpha ? AlphaDoPremultiply : AlphaDoNothing,
data.data()))
return false;
if (flipY) {
@@ -164,37 +164,37 @@ bool GraphicsContext3D::extractTextureData(unsigned int width, unsigned int heig
Vector<uint8_t>& data)
{
// Assumes format, type, etc. have already been validated.
- SourceDataFormat sourceDataFormat = kSourceFormatRGBA8;
+ SourceDataFormat sourceDataFormat = SourceFormatRGBA8;
switch (type) {
case UNSIGNED_BYTE:
switch (format) {
case RGBA:
- sourceDataFormat = kSourceFormatRGBA8;
+ sourceDataFormat = SourceFormatRGBA8;
break;
case RGB:
- sourceDataFormat = kSourceFormatRGB8;
+ sourceDataFormat = SourceFormatRGB8;
break;
case ALPHA:
- sourceDataFormat = kSourceFormatA8;
+ sourceDataFormat = SourceFormatA8;
break;
case LUMINANCE:
- sourceDataFormat = kSourceFormatR8;
+ sourceDataFormat = SourceFormatR8;
break;
case LUMINANCE_ALPHA:
- sourceDataFormat = kSourceFormatRA8;
+ sourceDataFormat = SourceFormatRA8;
break;
default:
ASSERT_NOT_REACHED();
}
break;
case UNSIGNED_SHORT_5_5_5_1:
- sourceDataFormat = kSourceFormatRGBA5551;
+ sourceDataFormat = SourceFormatRGBA5551;
break;
case UNSIGNED_SHORT_4_4_4_4:
- sourceDataFormat = kSourceFormatRGBA4444;
+ sourceDataFormat = SourceFormatRGBA4444;
break;
case UNSIGNED_SHORT_5_6_5:
- sourceDataFormat = kSourceFormatRGB565;
+ sourceDataFormat = SourceFormatRGB565;
break;
default:
ASSERT_NOT_REACHED();
@@ -213,7 +213,7 @@ bool GraphicsContext3D::extractTextureData(unsigned int width, unsigned int heig
sourceDataFormat,
width, height, unpackAlignment,
format, type,
- (premultiplyAlpha ? kAlphaDoPremultiply : kAlphaDoNothing),
+ (premultiplyAlpha ? AlphaDoPremultiply : AlphaDoNothing),
data.data()))
return false;
// The pixel data is now tightly packed.
@@ -566,7 +566,7 @@ void packRGBA8ToRGB8Unmultiply(const uint8_t* source, uint8_t* destination)
destination[2] = sourceB;
}
-// This is only used when the source format is different than kSourceFormatRGBA8.
+// This is only used when the source format is different than SourceFormatRGBA8.
void packRGBA8ToRGBA8(const uint8_t* source, uint8_t* destination)
{
destination[0] = source[0];
@@ -772,7 +772,7 @@ static void doPacking(const void* sourceData,
unsigned int destinationElementsPerPixel)
{
switch (sourceDataFormat) {
- case GraphicsContext3D::kSourceFormatRGBA8: {
+ case GraphicsContext3D::SourceFormatRGBA8: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
if (!sourceElementsPerRow) {
@@ -789,157 +789,157 @@ static void doPacking(const void* sourceData,
}
break;
}
- case GraphicsContext3D::kSourceFormatRGBA16Little: {
+ case GraphicsContext3D::SourceFormatRGBA16Little: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackRGBA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatRGBA16Big: {
+ case GraphicsContext3D::SourceFormatRGBA16Big: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackRGBA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatRGB8: {
+ case GraphicsContext3D::SourceFormatRGB8: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint8_t>(width, 3, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint8_t, DestType, unpackRGB8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatRGB16Little: {
+ case GraphicsContext3D::SourceFormatRGB16Little: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 6, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackRGB16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatRGB16Big: {
+ case GraphicsContext3D::SourceFormatRGB16Big: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 6, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackRGB16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatARGB8: {
+ case GraphicsContext3D::SourceFormatARGB8: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint8_t, DestType, unpackARGB8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatARGB16Little: {
+ case GraphicsContext3D::SourceFormatARGB16Little: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackARGB16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatARGB16Big: {
+ case GraphicsContext3D::SourceFormatARGB16Big: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackARGB16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatBGRA8: {
+ case GraphicsContext3D::SourceFormatBGRA8: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint8_t, DestType, unpackBGRA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatBGRA16Little: {
+ case GraphicsContext3D::SourceFormatBGRA16Little: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackBGRA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatBGRA16Big: {
+ case GraphicsContext3D::SourceFormatBGRA16Big: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 8, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackBGRA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatRGBA5551: {
+ case GraphicsContext3D::SourceFormatRGBA5551: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackRGBA5551ToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatRGBA4444: {
+ case GraphicsContext3D::SourceFormatRGBA4444: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackRGBA4444ToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatRGB565: {
+ case GraphicsContext3D::SourceFormatRGB565: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackRGB565ToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatR8: {
+ case GraphicsContext3D::SourceFormatR8: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint8_t>(width, 1, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint8_t, DestType, unpackR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatR16Little: {
+ case GraphicsContext3D::SourceFormatR16Little: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackR16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatR16Big: {
+ case GraphicsContext3D::SourceFormatR16Big: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackR16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatRA8: {
+ case GraphicsContext3D::SourceFormatRA8: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint8_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint8_t, DestType, unpackRA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatRA16Little: {
+ case GraphicsContext3D::SourceFormatRA16Little: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackRA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatRA16Big: {
+ case GraphicsContext3D::SourceFormatRA16Big: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackRA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatAR8: {
+ case GraphicsContext3D::SourceFormatAR8: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint8_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint8_t, DestType, unpackAR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatAR16Little: {
+ case GraphicsContext3D::SourceFormatAR16Little: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackAR16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatAR16Big: {
+ case GraphicsContext3D::SourceFormatAR16Big: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackAR16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatA8: {
+ case GraphicsContext3D::SourceFormatA8: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint8_t>(width, 1, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint8_t, DestType, unpackA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatA16Little: {
+ case GraphicsContext3D::SourceFormatA16Little: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackA16LittleToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
break;
}
- case GraphicsContext3D::kSourceFormatA16Big: {
+ case GraphicsContext3D::SourceFormatA16Big: {
unsigned int sourceElementsPerPixel, sourceElementsPerRow;
computeIncrementParameters<uint16_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
doUnpackingAndPacking<uint16_t, DestType, unpackA16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
@@ -963,7 +963,7 @@ bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
switch (destinationType) {
case UNSIGNED_BYTE: {
uint8_t* destination = static_cast<uint8_t*>(destinationData);
- if (sourceDataFormat == kSourceFormatRGBA8 && destinationFormat == RGBA && sourceUnpackAlignment <= 4 && alphaOp == kAlphaDoNothing) {
+ if (sourceDataFormat == SourceFormatRGBA8 && destinationFormat == RGBA && sourceUnpackAlignment <= 4 && alphaOp == AlphaDoNothing) {
// No conversion necessary.
memcpy(destinationData, sourceData, width * height * 4);
break;
@@ -971,27 +971,27 @@ bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
switch (destinationFormat) {
case RGB:
switch (alphaOp) {
- case kAlphaDoNothing:
+ case AlphaDoNothing:
doPacking<uint8_t, packRGBA8ToRGB8>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 3);
break;
- case kAlphaDoPremultiply:
+ case AlphaDoPremultiply:
doPacking<uint8_t, packRGBA8ToRGB8Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 3);
break;
- case kAlphaDoUnmultiply:
+ case AlphaDoUnmultiply:
doPacking<uint8_t, packRGBA8ToRGB8Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 3);
break;
}
break;
case RGBA:
switch (alphaOp) {
- case kAlphaDoNothing:
- ASSERT(sourceDataFormat != kSourceFormatRGBA8 || sourceUnpackAlignment > 4); // Handled above with fast case.
+ case AlphaDoNothing:
+ ASSERT(sourceDataFormat != SourceFormatRGBA8 || sourceUnpackAlignment > 4); // Handled above with fast case.
doPacking<uint8_t, packRGBA8ToRGBA8>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 4);
break;
- case kAlphaDoPremultiply:
+ case AlphaDoPremultiply:
doPacking<uint8_t, packRGBA8ToRGBA8Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 4);
break;
- case kAlphaDoUnmultiply:
+ case AlphaDoUnmultiply:
doPacking<uint8_t, packRGBA8ToRGBA8Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 4);
break;
default:
@@ -1009,13 +1009,13 @@ bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
// specification, Table 3.15), the red channel is chosen
// from the RGBA data.
switch (alphaOp) {
- case kAlphaDoNothing:
+ case AlphaDoNothing:
doPacking<uint8_t, packRGBA8ToR8>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
- case kAlphaDoPremultiply:
+ case AlphaDoPremultiply:
doPacking<uint8_t, packRGBA8ToR8Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
- case kAlphaDoUnmultiply:
+ case AlphaDoUnmultiply:
doPacking<uint8_t, packRGBA8ToR8Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
}
@@ -1025,13 +1025,13 @@ bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
// specification, Table 3.15), the red and alpha channels
// are chosen from the RGBA data.
switch (alphaOp) {
- case kAlphaDoNothing:
+ case AlphaDoNothing:
doPacking<uint8_t, packRGBA8ToRA8>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 2);
break;
- case kAlphaDoPremultiply:
+ case AlphaDoPremultiply:
doPacking<uint8_t, packRGBA8ToRA8Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 2);
break;
- case kAlphaDoUnmultiply:
+ case AlphaDoUnmultiply:
doPacking<uint8_t, packRGBA8ToRA8Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 2);
break;
}
@@ -1042,13 +1042,13 @@ bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
case UNSIGNED_SHORT_4_4_4_4: {
uint16_t* destination = static_cast<uint16_t*>(destinationData);
switch (alphaOp) {
- case kAlphaDoNothing:
+ case AlphaDoNothing:
doPacking<uint16_t, packRGBA8ToUnsignedShort4444>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
- case kAlphaDoPremultiply:
+ case AlphaDoPremultiply:
doPacking<uint16_t, packRGBA8ToUnsignedShort4444Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
- case kAlphaDoUnmultiply:
+ case AlphaDoUnmultiply:
doPacking<uint16_t, packRGBA8ToUnsignedShort4444Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
}
@@ -1057,13 +1057,13 @@ bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
case UNSIGNED_SHORT_5_5_5_1: {
uint16_t* destination = static_cast<uint16_t*>(destinationData);
switch (alphaOp) {
- case kAlphaDoNothing:
+ case AlphaDoNothing:
doPacking<uint16_t, packRGBA8ToUnsignedShort5551>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
- case kAlphaDoPremultiply:
+ case AlphaDoPremultiply:
doPacking<uint16_t, packRGBA8ToUnsignedShort5551Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
- case kAlphaDoUnmultiply:
+ case AlphaDoUnmultiply:
doPacking<uint16_t, packRGBA8ToUnsignedShort5551Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
}
@@ -1072,13 +1072,13 @@ bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
case UNSIGNED_SHORT_5_6_5: {
uint16_t* destination = static_cast<uint16_t*>(destinationData);
switch (alphaOp) {
- case kAlphaDoNothing:
+ case AlphaDoNothing:
doPacking<uint16_t, packRGBA8ToUnsignedShort565>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
- case kAlphaDoPremultiply:
+ case AlphaDoPremultiply:
doPacking<uint16_t, packRGBA8ToUnsignedShort565Premultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
- case kAlphaDoUnmultiply:
+ case AlphaDoUnmultiply:
doPacking<uint16_t, packRGBA8ToUnsignedShort565Unmultiply>(sourceData, sourceDataFormat, width, height, sourceUnpackAlignment, destination, 1);
break;
}
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index 20b4e2d..5074bbf 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -540,34 +540,34 @@ public:
// uploading. This enum must be public because it is accessed
// by non-member functions.
enum SourceDataFormat {
- kSourceFormatRGBA8 = 0,
- kSourceFormatRGBA16Little,
- kSourceFormatRGBA16Big,
- kSourceFormatRGB8,
- kSourceFormatRGB16Little,
- kSourceFormatRGB16Big,
- kSourceFormatBGRA8,
- kSourceFormatBGRA16Little,
- kSourceFormatBGRA16Big,
- kSourceFormatARGB8,
- kSourceFormatARGB16Little,
- kSourceFormatARGB16Big,
- kSourceFormatRGBA5551,
- kSourceFormatRGBA4444,
- kSourceFormatRGB565,
- kSourceFormatR8,
- kSourceFormatR16Little,
- kSourceFormatR16Big,
- kSourceFormatRA8,
- kSourceFormatRA16Little,
- kSourceFormatRA16Big,
- kSourceFormatAR8,
- kSourceFormatAR16Little,
- kSourceFormatAR16Big,
- kSourceFormatA8,
- kSourceFormatA16Little,
- kSourceFormatA16Big,
- kSourceFormatNumFormats
+ SourceFormatRGBA8 = 0,
+ SourceFormatRGBA16Little,
+ SourceFormatRGBA16Big,
+ SourceFormatRGB8,
+ SourceFormatRGB16Little,
+ SourceFormatRGB16Big,
+ SourceFormatBGRA8,
+ SourceFormatBGRA16Little,
+ SourceFormatBGRA16Big,
+ SourceFormatARGB8,
+ SourceFormatARGB16Little,
+ SourceFormatARGB16Big,
+ SourceFormatRGBA5551,
+ SourceFormatRGBA4444,
+ SourceFormatRGB565,
+ SourceFormatR8,
+ SourceFormatR16Little,
+ SourceFormatR16Big,
+ SourceFormatRA8,
+ SourceFormatRA16Little,
+ SourceFormatRA16Big,
+ SourceFormatAR8,
+ SourceFormatAR16Little,
+ SourceFormatAR16Big,
+ SourceFormatA8,
+ SourceFormatA16Little,
+ SourceFormatA16Big,
+ SourceFormatNumFormats
};
//----------------------------------------------------------------------
@@ -832,9 +832,9 @@ public:
// pixel packing. FIXME: kAlphaDoUnmultiply is lossy and must
// be removed.
enum AlphaOp {
- kAlphaDoNothing = 0,
- kAlphaDoPremultiply = 1,
- kAlphaDoUnmultiply = 2
+ AlphaDoNothing = 0,
+ AlphaDoPremultiply = 1,
+ AlphaDoUnmultiply = 2
};
// Helper for getImageData which implements packing of pixel
diff --git a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
index a1cc805..60b5033 100644
--- a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
@@ -59,7 +59,7 @@ enum AlphaFormat {
AlphaFormatNumFormats
};
-// This returns kSourceFormatNumFormats if the combination of input parameters is unsupported.
+// This returns SourceFormatNumFormats if the combination of input parameters is unsupported.
static GraphicsContext3D::SourceDataFormat getSourceDataFormat(unsigned int componentsPerPixel, AlphaFormat alphaFormat, bool is16BitFormat, bool bigEndian)
{
const static SourceDataFormatBase formatTableBase[4][AlphaFormatNumFormats] = { // componentsPerPixel x AlphaFormat
@@ -70,20 +70,20 @@ static GraphicsContext3D::SourceDataFormat getSourceDataFormat(unsigned int comp
{ SourceFormatBaseNumFormats, SourceFormatBaseARGB, SourceFormatBaseRGBA } // 4 componentsPerPixel
};
const static GraphicsContext3D::SourceDataFormat formatTable[SourceFormatBaseNumFormats][3] = { // SourceDataFormatBase x bitsPerComponentAndEndian
- // 8bits 16bits, little endian 16bits, big endian
- { GraphicsContext3D::kSourceFormatR8, GraphicsContext3D::kSourceFormatR16Little, GraphicsContext3D::kSourceFormatR16Big },
- { GraphicsContext3D::kSourceFormatA8, GraphicsContext3D::kSourceFormatA16Little, GraphicsContext3D::kSourceFormatA16Big },
- { GraphicsContext3D::kSourceFormatRA8, GraphicsContext3D::kSourceFormatRA16Little, GraphicsContext3D::kSourceFormatRA16Big },
- { GraphicsContext3D::kSourceFormatAR8, GraphicsContext3D::kSourceFormatAR16Little, GraphicsContext3D::kSourceFormatAR16Big },
- { GraphicsContext3D::kSourceFormatRGB8, GraphicsContext3D::kSourceFormatRGB16Little, GraphicsContext3D::kSourceFormatRGB16Big },
- { GraphicsContext3D::kSourceFormatRGBA8, GraphicsContext3D::kSourceFormatRGBA16Little, GraphicsContext3D::kSourceFormatRGBA16Big },
- { GraphicsContext3D::kSourceFormatARGB8, GraphicsContext3D::kSourceFormatARGB16Little, GraphicsContext3D::kSourceFormatARGB16Big }
+ // 8bits 16bits, little endian 16bits, big endian
+ { GraphicsContext3D::SourceFormatR8, GraphicsContext3D::SourceFormatR16Little, GraphicsContext3D::SourceFormatR16Big },
+ { GraphicsContext3D::SourceFormatA8, GraphicsContext3D::SourceFormatA16Little, GraphicsContext3D::SourceFormatA16Big },
+ { GraphicsContext3D::SourceFormatRA8, GraphicsContext3D::SourceFormatRA16Little, GraphicsContext3D::SourceFormatRA16Big },
+ { GraphicsContext3D::SourceFormatAR8, GraphicsContext3D::SourceFormatAR16Little, GraphicsContext3D::SourceFormatAR16Big },
+ { GraphicsContext3D::SourceFormatRGB8, GraphicsContext3D::SourceFormatRGB16Little, GraphicsContext3D::SourceFormatRGB16Big },
+ { GraphicsContext3D::SourceFormatRGBA8, GraphicsContext3D::SourceFormatRGBA16Little, GraphicsContext3D::SourceFormatRGBA16Big },
+ { GraphicsContext3D::SourceFormatARGB8, GraphicsContext3D::SourceFormatARGB16Little, GraphicsContext3D::SourceFormatARGB16Big }
};
ASSERT(componentsPerPixel <= 4 && componentsPerPixel > 0);
SourceDataFormatBase formatBase = formatTableBase[componentsPerPixel - 1][alphaFormat];
if (formatBase == SourceFormatBaseNumFormats)
- return GraphicsContext3D::kSourceFormatNumFormats;
+ return GraphicsContext3D::SourceFormatNumFormats;
if (!is16BitFormat)
return formatTable[formatBase][0];
if (!bigEndian)
@@ -146,7 +146,7 @@ bool GraphicsContext3D::getImageData(Image* image,
}
}
- AlphaOp neededAlphaOp = kAlphaDoNothing;
+ AlphaOp neededAlphaOp = AlphaDoNothing;
AlphaFormat alphaFormat = AlphaFormatNone;
switch (CGImageGetAlphaInfo(cgImage)) {
case kCGImageAlphaPremultipliedFirst:
@@ -155,13 +155,13 @@ bool GraphicsContext3D::getImageData(Image* image,
// in which case image->data() should be null.
ASSERT(!image->data());
if (!premultiplyAlpha)
- neededAlphaOp = kAlphaDoUnmultiply;
+ neededAlphaOp = AlphaDoUnmultiply;
alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaFirst:
// This path is only accessible for MacOS earlier than 10.6.4.
if (premultiplyAlpha)
- neededAlphaOp = kAlphaDoPremultiply;
+ neededAlphaOp = AlphaDoPremultiply;
alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaNoneSkipFirst:
@@ -173,12 +173,12 @@ bool GraphicsContext3D::getImageData(Image* image,
// in which case image->data() should be null.
ASSERT(!image->data());
if (!premultiplyAlpha)
- neededAlphaOp = kAlphaDoUnmultiply;
+ neededAlphaOp = AlphaDoUnmultiply;
alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaLast:
if (premultiplyAlpha)
- neededAlphaOp = kAlphaDoPremultiply;
+ neededAlphaOp = AlphaDoPremultiply;
alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaNoneSkipLast:
@@ -191,7 +191,7 @@ bool GraphicsContext3D::getImageData(Image* image,
return false;
}
SourceDataFormat srcDataFormat = getSourceDataFormat(componentsPerPixel, alphaFormat, bitsPerComponent == 16, srcByteOrder16Big);
- if (srcDataFormat == kSourceFormatNumFormats)
+ if (srcDataFormat == SourceFormatNumFormats)
return false;
RetainPtr<CFDataRef> pixelData;
diff --git a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
index c503307..d0dafb1 100644
--- a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
@@ -48,7 +48,7 @@ bool GraphicsContext3D::getImageData(Image* image,
return false;
OwnPtr<NativeImageSkia> pixels;
NativeImageSkia* skiaImage = 0;
- AlphaOp neededAlphaOp = kAlphaDoNothing;
+ AlphaOp neededAlphaOp = AlphaDoNothing;
if (image->data()) {
ImageSource decoder(false);
decoder.setData(image->data(), true);
@@ -63,12 +63,12 @@ bool GraphicsContext3D::getImageData(Image* image,
return false;
skiaImage = pixels.get();
if (hasAlpha && premultiplyAlpha)
- neededAlphaOp = kAlphaDoPremultiply;
+ neededAlphaOp = AlphaDoPremultiply;
} else {
// This is a special case for texImage2D with HTMLCanvasElement input.
skiaImage = image->nativeImageForCurrentFrame();
if (!premultiplyAlpha)
- neededAlphaOp = kAlphaDoUnmultiply;
+ neededAlphaOp = AlphaDoUnmultiply;
}
if (!skiaImage)
return false;
@@ -77,7 +77,7 @@ bool GraphicsContext3D::getImageData(Image* image,
ASSERT(skiaImage->rowBytes() == skiaImage->width() * 4);
outputVector.resize(skiaImage->rowBytes() * skiaImage->height());
return packPixels(reinterpret_cast<const uint8_t*>(skiaImage->getPixels()),
- kSourceFormatBGRA8, skiaImage->width(), skiaImage->height(), 0,
+ SourceFormatBGRA8, skiaImage->width(), skiaImage->height(), 0,
format, type, neededAlphaOp, outputVector.data());
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list