Rename "color" functions to "pixel" functions.
This extends of the copy, read and write functions to cover depth and
stencil formats.
Refactoring change only.
Bug: angleproject:2673
Change-Id: I4b0b2f4cf8621051cacd95cdbd6d70f94ca612e2
Reviewed-on: https://chromium-review.googlesource.com/1147152
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/Format.h b/src/libANGLE/renderer/Format.h
index e576422..a79573b 100644
--- a/src/libANGLE/renderer/Format.h
+++ b/src/libANGLE/renderer/Format.h
@@ -25,8 +25,8 @@
GLenum fboFormat,
rx::MipGenerationFunction mipGen,
const rx::FastCopyFunctionMap &fastCopyFunctions,
- rx::ColorReadFunction colorRead,
- rx::ColorWriteFunction colorWrite,
+ rx::PixelReadFunction colorRead,
+ rx::PixelWriteFunction colorWrite,
GLenum componentType,
GLuint redBits,
GLuint greenBits,
@@ -56,8 +56,8 @@
GLenum fboImplementationInternalFormat;
rx::MipGenerationFunction mipGenerationFunction;
- rx::ColorReadFunction colorReadFunction;
- rx::ColorWriteFunction colorWriteFunction;
+ rx::PixelReadFunction pixelReadFunction;
+ rx::PixelWriteFunction pixelWriteFunction;
// A map from a gl::FormatType to a fast pixel copy function for this format.
const rx::FastCopyFunctionMap &fastCopyFunctions;
@@ -81,8 +81,8 @@
GLenum fboFormat,
rx::MipGenerationFunction mipGen,
const rx::FastCopyFunctionMap &fastCopyFunctions,
- rx::ColorReadFunction colorRead,
- rx::ColorWriteFunction colorWrite,
+ rx::PixelReadFunction colorRead,
+ rx::PixelWriteFunction colorWrite,
GLenum componentType,
GLuint redBits,
GLuint greenBits,
@@ -96,8 +96,8 @@
glInternalFormat(glFormat),
fboImplementationInternalFormat(fboFormat),
mipGenerationFunction(mipGen),
- colorReadFunction(colorRead),
- colorWriteFunction(colorWrite),
+ pixelReadFunction(colorRead),
+ pixelWriteFunction(colorWrite),
fastCopyFunctions(fastCopyFunctions),
componentType(componentType),
redBits(redBits),
diff --git a/src/libANGLE/renderer/d3d/d3d11/Image11.cpp b/src/libANGLE/renderer/d3d/d3d11/Image11.cpp
index ac88e22..91ce838 100644
--- a/src/libANGLE/renderer/d3d/d3d11/Image11.cpp
+++ b/src/libANGLE/renderer/d3d/d3d11/Image11.cpp
@@ -118,8 +118,8 @@
destOffset.y * destMapped.RowPitch;
CopyImageCHROMIUM(sourceData, srcMapped.RowPitch, sourcePixelBytes,
- sourceFormat.colorReadFunction, destData, destMapped.RowPitch, destPixelBytes,
- destFormat.colorWriteFunction, destUnsizedFormat,
+ sourceFormat.pixelReadFunction, destData, destMapped.RowPitch, destPixelBytes,
+ destFormat.pixelWriteFunction, destUnsizedFormat,
destFormatInfo.componentType, sourceRect.width, sourceRect.height,
unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
diff --git a/src/libANGLE/renderer/d3d/d3d9/Image9.cpp b/src/libANGLE/renderer/d3d/d3d9/Image9.cpp
index 0ddcc83..19ac8b2 100644
--- a/src/libANGLE/renderer/d3d/d3d9/Image9.cpp
+++ b/src/libANGLE/renderer/d3d/d3d9/Image9.cpp
@@ -226,8 +226,8 @@
ASSERT(sourceData && destData);
CopyImageCHROMIUM(sourceData, sourceLocked.Pitch, sourceD3DFormatInfo.pixelBytes,
- sourceD3DFormatInfo.info().colorReadFunction, destData, destLocked.Pitch,
- destD3DFormatInfo.pixelBytes, destD3DFormatInfo.info().colorWriteFunction,
+ sourceD3DFormatInfo.info().pixelReadFunction, destData, destLocked.Pitch,
+ destD3DFormatInfo.pixelBytes, destD3DFormatInfo.info().pixelWriteFunction,
gl::GetUnsizedFormat(dest->getInternalFormat()),
destD3DFormatInfo.info().componentType, sourceRect.width, sourceRect.height,
unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
diff --git a/src/libANGLE/renderer/gl/BlitGL.cpp b/src/libANGLE/renderer/gl/BlitGL.cpp
index 5a0f4a7..a01baca 100644
--- a/src/libANGLE/renderer/gl/BlitGL.cpp
+++ b/src/libANGLE/renderer/gl/BlitGL.cpp
@@ -607,7 +607,7 @@
uint8_t *destMemory = buffer->data() + sourceBufferSize;
GLenum readPixelsFormat = GL_NONE;
- ColorReadFunction readFunction = nullptr;
+ PixelReadFunction readFunction = nullptr;
if (sourceComponentType == GL_UNSIGNED_INT)
{
readPixelsFormat = GL_RGBA_INTEGER;
@@ -633,7 +633,7 @@
CopyImageCHROMIUM(
sourceMemory, sourceArea.width * sourcePixelSize, sourcePixelSize, readFunction, destMemory,
sourceArea.width * destInternalFormatInfo.pixelBytes, destInternalFormatInfo.pixelBytes,
- destFormatInfo.colorWriteFunction, destInternalFormatInfo.format,
+ destFormatInfo.pixelWriteFunction, destInternalFormatInfo.format,
destInternalFormatInfo.componentType, sourceArea.width, sourceArea.height, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
diff --git a/src/libANGLE/renderer/renderer_utils.cpp b/src/libANGLE/renderer/renderer_utils.cpp
index 5b2679c..6230556 100644
--- a/src/libANGLE/renderer/renderer_utils.cpp
+++ b/src/libANGLE/renderer/renderer_utils.cpp
@@ -84,7 +84,7 @@
}
void WriteUintColor(const gl::ColorF &color,
- ColorWriteFunction colorWriteFunction,
+ PixelWriteFunction colorWriteFunction,
uint8_t *destPixelData)
{
gl::ColorUI destColor(
@@ -94,7 +94,7 @@
}
void WriteFloatColor(const gl::ColorF &color,
- ColorWriteFunction colorWriteFunction,
+ PixelWriteFunction colorWriteFunction,
uint8_t *destPixelData)
{
colorWriteFunction(reinterpret_cast<const uint8_t *>(&color), destPixelData);
@@ -211,7 +211,7 @@
return;
}
- ColorCopyFunction fastCopyFunc = sourceFormat.fastCopyFunctions.get(params.destFormat->id);
+ PixelCopyFunction fastCopyFunc = sourceFormat.fastCopyFunctions.get(params.destFormat->id);
if (fastCopyFunc)
{
@@ -230,8 +230,8 @@
return;
}
- ColorWriteFunction colorWriteFunction = params.destFormat->colorWriteFunction;
- ASSERT(colorWriteFunction != nullptr);
+ PixelWriteFunction pixelWriteFunction = params.destFormat->pixelWriteFunction;
+ ASSERT(pixelWriteFunction != nullptr);
// Maximum size of any Color<T> type used.
uint8_t temp[16];
@@ -240,8 +240,8 @@
sizeof(temp) >= sizeof(angle::DepthStencil),
"Unexpected size of pixel struct.");
- ColorReadFunction colorReadFunction = sourceFormat.colorReadFunction;
- ASSERT(colorReadFunction != nullptr);
+ PixelReadFunction pixelReadFunction = sourceFormat.pixelReadFunction;
+ ASSERT(pixelReadFunction != nullptr);
for (int y = 0; y < params.area.height; ++y)
{
@@ -253,8 +253,8 @@
// readFunc and writeFunc will be using the same type of color, CopyTexImage
// will not allow the copy otherwise.
- colorReadFunction(src, temp);
- colorWriteFunction(temp, dest);
+ pixelReadFunction(src, temp);
+ pixelWriteFunction(temp, dest);
}
}
}
@@ -264,7 +264,7 @@
return (get(formatID) != nullptr);
}
-ColorCopyFunction FastCopyFunctionMap::get(angle::FormatID formatID) const
+PixelCopyFunction FastCopyFunctionMap::get(angle::FormatID formatID) const
{
for (size_t index = 0; index < mSize; ++index)
{
@@ -307,11 +307,11 @@
void CopyImageCHROMIUM(const uint8_t *sourceData,
size_t sourceRowPitch,
size_t sourcePixelBytes,
- ColorReadFunction colorReadFunction,
+ PixelReadFunction pixelReadFunction,
uint8_t *destData,
size_t destRowPitch,
size_t destPixelBytes,
- ColorWriteFunction colorWriteFunction,
+ PixelWriteFunction pixelWriteFunction,
GLenum destUnsizedFormat,
GLenum destComponentType,
size_t width,
@@ -363,7 +363,7 @@
const uint8_t *sourcePixelData = sourceData + y * sourceRowPitch + x * sourcePixelBytes;
gl::ColorF sourceColor;
- colorReadFunction(sourcePixelData, reinterpret_cast<uint8_t *>(&sourceColor));
+ pixelReadFunction(sourcePixelData, reinterpret_cast<uint8_t *>(&sourceColor));
conversionFunction(&sourceColor);
clipChannelsFunction(&sourceColor);
@@ -380,7 +380,7 @@
}
uint8_t *destPixelData = destData + destY * destRowPitch + x * destPixelBytes;
- writeFunction(sourceColor, colorWriteFunction, destPixelData);
+ writeFunction(sourceColor, pixelWriteFunction, destPixelData);
}
}
}
diff --git a/src/libANGLE/renderer/renderer_utils.h b/src/libANGLE/renderer/renderer_utils.h
index 34140bf..9f0573c 100644
--- a/src/libANGLE/renderer/renderer_utils.h
+++ b/src/libANGLE/renderer/renderer_utils.h
@@ -122,9 +122,9 @@
size_t destRowPitch,
size_t destDepthPitch);
-typedef void (*ColorReadFunction)(const uint8_t *source, uint8_t *dest);
-typedef void (*ColorWriteFunction)(const uint8_t *source, uint8_t *dest);
-typedef void (*ColorCopyFunction)(const uint8_t *source, uint8_t *dest);
+typedef void (*PixelReadFunction)(const uint8_t *source, uint8_t *dest);
+typedef void (*PixelWriteFunction)(const uint8_t *source, uint8_t *dest);
+typedef void (*PixelCopyFunction)(const uint8_t *source, uint8_t *dest);
class FastCopyFunctionMap
{
@@ -132,7 +132,7 @@
struct Entry
{
angle::FormatID formatID;
- ColorCopyFunction func;
+ PixelCopyFunction func;
};
constexpr FastCopyFunctionMap() : FastCopyFunctionMap(nullptr, 0) {}
@@ -140,7 +140,7 @@
constexpr FastCopyFunctionMap(const Entry *data, size_t size) : mSize(size), mData(data) {}
bool has(angle::FormatID formatID) const;
- ColorCopyFunction get(angle::FormatID formatID) const;
+ PixelCopyFunction get(angle::FormatID formatID) const;
private:
size_t mSize;
@@ -208,11 +208,11 @@
void CopyImageCHROMIUM(const uint8_t *sourceData,
size_t sourceRowPitch,
size_t sourcePixelBytes,
- ColorReadFunction readFunction,
+ PixelReadFunction pixelReadFunction,
uint8_t *destData,
size_t destRowPitch,
size_t destPixelBytes,
- ColorWriteFunction colorWriteFunction,
+ PixelWriteFunction pixelWriteFunction,
GLenum destUnsizedFormat,
GLenum destComponentType,
size_t width,
diff --git a/src/libANGLE/renderer/vulkan/TextureVk.cpp b/src/libANGLE/renderer/vulkan/TextureVk.cpp
index 91658e2..f9fc8d0 100644
--- a/src/libANGLE/renderer/vulkan/TextureVk.cpp
+++ b/src/libANGLE/renderer/vulkan/TextureVk.cpp
@@ -669,8 +669,8 @@
GLuint destDataRowPitch = sourceArea.width * destAngleFormat.pixelBytes;
CopyImageCHROMIUM(sourceData, sourceDataRowPitch, sourceAngleFormat.pixelBytes,
- sourceAngleFormat.colorReadFunction, destData, destDataRowPitch,
- destAngleFormat.pixelBytes, destAngleFormat.colorWriteFunction,
+ sourceAngleFormat.pixelReadFunction, destData, destDataRowPitch,
+ destAngleFormat.pixelBytes, destAngleFormat.pixelWriteFunction,
destFormat.format, destFormat.componentType, sourceArea.width,
sourceArea.height, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha);