Commit d3404ffd by Jamie Madill

Optimize LoadL8ToRGBA8.

We can save some work by re-using the color value in a temporary. BUG=angle:842 Change-Id: Ib64b34ca7bc77c73368e159527ad84419079f958 Reviewed-on: https://chromium-review.googlesource.com/231997Reviewed-by: 's avatarBruce Dawson <brucedawson@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 149257f5
...@@ -91,9 +91,10 @@ void LoadL8ToRGBA8(size_t width, size_t height, size_t depth, ...@@ -91,9 +91,10 @@ void LoadL8ToRGBA8(size_t width, size_t height, size_t depth,
uint8_t *dest = OffsetDataPointer<uint8_t>(output, y, z, outputRowPitch, outputDepthPitch); uint8_t *dest = OffsetDataPointer<uint8_t>(output, y, z, outputRowPitch, outputDepthPitch);
for (size_t x = 0; x < width; x++) for (size_t x = 0; x < width; x++)
{ {
dest[4 * x + 0] = source[x]; uint8_t sourceVal = source[x];
dest[4 * x + 1] = source[x]; dest[4 * x + 0] = sourceVal;
dest[4 * x + 2] = source[x]; dest[4 * x + 1] = sourceVal;
dest[4 * x + 2] = sourceVal;
dest[4 * x + 3] = 0xFF; dest[4 * x + 3] = 0xFF;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment