| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 ColorBehavior::transformToTargetForTesting())); | 133 ColorBehavior::transformToTargetForTesting())); |
| 134 ASSERT_NE(imageBitmapInteriorCrop->bitmapImage()->imageForCurrentFrame( | 134 ASSERT_NE(imageBitmapInteriorCrop->bitmapImage()->imageForCurrentFrame( |
| 135 ColorBehavior::transformToTargetForTesting()), | 135 ColorBehavior::transformToTargetForTesting()), |
| 136 imageElement->cachedImage()->getImage()->imageForCurrentFrame( | 136 imageElement->cachedImage()->getImage()->imageForCurrentFrame( |
| 137 ColorBehavior::transformToTargetForTesting())); | 137 ColorBehavior::transformToTargetForTesting())); |
| 138 ASSERT_NE(imageBitmapExteriorCrop->bitmapImage()->imageForCurrentFrame( | 138 ASSERT_NE(imageBitmapExteriorCrop->bitmapImage()->imageForCurrentFrame( |
| 139 ColorBehavior::transformToTargetForTesting()), | 139 ColorBehavior::transformToTargetForTesting()), |
| 140 imageElement->cachedImage()->getImage()->imageForCurrentFrame( | 140 imageElement->cachedImage()->getImage()->imageForCurrentFrame( |
| 141 ColorBehavior::transformToTargetForTesting())); | 141 ColorBehavior::transformToTargetForTesting())); |
| 142 | 142 |
| 143 StaticBitmapImage* emptyImage = imageBitmapOutsideCrop->bitmapImage(); | 143 RefPtr<StaticBitmapImage> emptyImage = imageBitmapOutsideCrop->bitmapImage(); |
| 144 ASSERT_NE(emptyImage->imageForCurrentFrame( | 144 ASSERT_NE(emptyImage->imageForCurrentFrame( |
| 145 ColorBehavior::transformToTargetForTesting()), | 145 ColorBehavior::transformToTargetForTesting()), |
| 146 imageElement->cachedImage()->getImage()->imageForCurrentFrame( | 146 imageElement->cachedImage()->getImage()->imageForCurrentFrame( |
| 147 ColorBehavior::transformToTargetForTesting())); | 147 ColorBehavior::transformToTargetForTesting())); |
| 148 } | 148 } |
| 149 | 149 |
| 150 // Verifies that ImageBitmaps constructed from HTMLImageElements hold a | 150 // Verifies that ImageBitmaps constructed from HTMLImageElements hold a |
| 151 // reference to the original Image if the HTMLImageElement src is changed. | 151 // reference to the original Image if the HTMLImageElement src is changed. |
| 152 TEST_F(ImageBitmapTest, ImageBitmapSourceChanged) { | 152 TEST_F(ImageBitmapTest, ImageBitmapSourceChanged) { |
| 153 HTMLImageElement* image = HTMLImageElement::create(*Document::create()); | 153 HTMLImageElement* image = HTMLImageElement::create(*Document::create()); |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 colorSpaceXform->apply(colorFormat, transformedPixel.get(), colorFormat32, | 600 colorSpaceXform->apply(colorFormat, transformedPixel.get(), colorFormat32, |
| 601 srcPixel.get(), 1, | 601 srcPixel.get(), 1, |
| 602 SkAlphaType::kUnpremul_SkAlphaType); | 602 SkAlphaType::kUnpremul_SkAlphaType); |
| 603 int compare = std::memcmp(convertedPixel.get(), transformedPixel.get(), | 603 int compare = std::memcmp(convertedPixel.get(), transformedPixel.get(), |
| 604 imageInfo.bytesPerPixel()); | 604 imageInfo.bytesPerPixel()); |
| 605 ASSERT_EQ(compare, 0); | 605 ASSERT_EQ(compare, 0); |
| 606 } | 606 } |
| 607 } | 607 } |
| 608 | 608 |
| 609 } // namespace blink | 609 } // namespace blink |
| OLD | NEW |