Improving GestureNav screenshotting performance - Part 1 - gl_helper
commita73ebd2e88a5a0e310d9741d56129827195afa27
authormfomitchev <mfomitchev@chromium.org>
Mon, 25 Aug 2014 22:14:34 +0000 (25 15:14 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 25 Aug 2014 22:17:05 +0000 (25 22:17 +0000)
tree0f3a38b0457f2fa6ad17b7eff12a51cd73ff7479
parent04f49f48a13c337cb9eaef0146ec4f15ed91984a
Improving GestureNav screenshotting performance - Part 1 - gl_helper

Pixel readback in GL_RGBA format can be a very expensive operation on
some hardware configurations.

Adding support for kAlpha_8_SkColorType to CropScaleReadbackAndCleanTexture().
For this color type, the texture is converted to grayscale on the GPU and then
read back using GL_BGRA_EXT format.
This improves the readback performance because we read four times less
data and we don't have to do any format conversions as we are reading.

Original review: https://codereview.chromium.org/384453002/
Part 2: https://codereview.chromium.org/389683002/

BUG=379983, 380779

Review URL: https://codereview.chromium.org/388953002

Cr-Commit-Position: refs/heads/master@{#291768}
content/common/gpu/client/gl_helper.cc
content/common/gpu/client/gl_helper.h
content/common/gpu/client/gl_helper_unittest.cc