diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-26 23:04:50 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-26 23:04:50 +0000 |
commit | b562a2f2c59d1f9fc85bb501b81f3396b2f9ed4a (patch) | |
tree | e6d40603ec997e4b9ee21c6f6970540d7c771a82 /cc/test/pixel_test_utils.cc | |
parent | 09ca0cc9b1c724aedc71447b6d09ada52f25d311 (diff) | |
download | chromium_src-b562a2f2c59d1f9fc85bb501b81f3396b2f9ed4a.zip chromium_src-b562a2f2c59d1f9fc85bb501b81f3396b2f9ed4a.tar.gz chromium_src-b562a2f2c59d1f9fc85bb501b81f3396b2f9ed4a.tar.bz2 |
Revert 190786 "Optimize SkColorFilters when drawing RenderPassQuads"
> Optimize SkColorFilters when drawing RenderPassQuads
>
> Pull the color transformation matrix from the SkImageFilter if possible
> and apply with a shader. Handles all permutations of shaders.
>
> BUG=168719
>
>
> Review URL: https://chromiumcodereview.appspot.com/12803003
TBR=clholgat@chromium.org
Review URL: https://codereview.chromium.org/13101002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/pixel_test_utils.cc')
-rw-r--r-- | cc/test/pixel_test_utils.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/cc/test/pixel_test_utils.cc b/cc/test/pixel_test_utils.cc index cedb386..ead2f6f 100644 --- a/cc/test/pixel_test_utils.cc +++ b/cc/test/pixel_test_utils.cc @@ -14,9 +14,9 @@ namespace cc { -bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path, - bool discard_transparency) { +bool WritePNGFile(const SkBitmap& bitmap, const base::FilePath& file_path) { std::vector<unsigned char> png_data; + const bool discard_transparency = true; if (gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, discard_transparency, &png_data) && @@ -37,8 +37,7 @@ bool ReadPNGFile(const base::FilePath& file_path, SkBitmap* bitmap) { bitmap); } -bool IsSameAsPNGFile(const SkBitmap& gen_bmp, base::FilePath ref_img_path, - bool discard_transparency) { +bool IsSameAsPNGFile(const SkBitmap& gen_bmp, base::FilePath ref_img_path) { SkBitmap ref_bmp; if (!ReadPNGFile(ref_img_path, &ref_bmp)) { LOG(ERROR) << "Cannot read reference image: " << ref_img_path.value(); @@ -61,12 +60,7 @@ bool IsSameAsPNGFile(const SkBitmap& gen_bmp, base::FilePath ref_img_path, SkAutoLockPixels lock_ref_bmp(ref_bmp); // The reference images were saved with no alpha channel. Use the mask to // set alpha to 0. - uint32_t kAlphaMask; - if (discard_transparency) - kAlphaMask = 0x00FFFFFF; - else - kAlphaMask = 0xFFFFFFFF; - + uint32_t kAlphaMask = 0x00FFFFFF; for (int x = 0; x < gen_bmp.width(); ++x) { for (int y = 0; y < gen_bmp.height(); ++y) { if ((*gen_bmp.getAddr32(x, y) & kAlphaMask) != |