summaryrefslogtreecommitdiffstats
path: root/skia/ext
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 17:51:58 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 17:51:58 +0000
commita6ed015caa2c8c20b602b3b8873443ec035ca43c (patch)
tree5038b628263a72669f7857efef083987766fbe77 /skia/ext
parentebf405054443e82fb40900c6c349e871bf0d40f1 (diff)
downloadchromium_src-a6ed015caa2c8c20b602b3b8873443ec035ca43c.zip
chromium_src-a6ed015caa2c8c20b602b3b8873443ec035ca43c.tar.gz
chromium_src-a6ed015caa2c8c20b602b3b8873443ec035ca43c.tar.bz2
Update webkit to r44571
BUG=none TEST=none R=pkasting Review URL: http://codereview.chromium.org/119430 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18073 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext')
-rw-r--r--skia/ext/vector_canvas_unittest.cc28
1 files changed, 18 insertions, 10 deletions
diff --git a/skia/ext/vector_canvas_unittest.cc b/skia/ext/vector_canvas_unittest.cc
index 0d63b00..5dbd17f 100644
--- a/skia/ext/vector_canvas_unittest.cc
+++ b/skia/ext/vector_canvas_unittest.cc
@@ -317,14 +317,16 @@ void Premultiply(SkBitmap bitmap) {
}
}
-void LoadPngFileToSkBitmap(const std::wstring& filename, SkBitmap* bitmap) {
+void LoadPngFileToSkBitmap(const std::wstring& filename,
+ SkBitmap* bitmap,
+ bool is_opaque) {
Vector<char> compressed;
ReadFileToVector(filename, &compressed);
EXPECT_TRUE(compressed.size());
WebCore::PNGImageDecoder decoder;
decoder.setData(WebCore::SharedBuffer::adoptVector(compressed).get(), true);
*bitmap = decoder.frameBufferAtIndex(0)->bitmap();
- EXPECT_FALSE(bitmap->isOpaque());
+ EXPECT_EQ(is_opaque, bitmap->isOpaque());
Premultiply(*bitmap);
}
@@ -793,7 +795,7 @@ TEST_F(VectorCanvasTest, PathEffects) {
TEST_F(VectorCanvasTest, Bitmaps) {
{
SkBitmap bitmap;
- LoadPngFileToSkBitmap(test_file(L"bitmap_opaque.png"), &bitmap);
+ LoadPngFileToSkBitmap(test_file(L"bitmap_opaque.png"), &bitmap, true);
vcanvas_->drawBitmap(bitmap, 13, 3, NULL);
pcanvas_->drawBitmap(bitmap, 13, 3, NULL);
EXPECT_EQ(0., ProcessImage(L"opaque"));
@@ -801,7 +803,7 @@ TEST_F(VectorCanvasTest, Bitmaps) {
{
SkBitmap bitmap;
- LoadPngFileToSkBitmap(test_file(L"bitmap_alpha.png"), &bitmap);
+ LoadPngFileToSkBitmap(test_file(L"bitmap_alpha.png"), &bitmap, false);
vcanvas_->drawBitmap(bitmap, 5, 15, NULL);
pcanvas_->drawBitmap(bitmap, 5, 15, NULL);
EXPECT_EQ(0., ProcessImage(L"alpha"));
@@ -810,7 +812,8 @@ TEST_F(VectorCanvasTest, Bitmaps) {
TEST_F(VectorCanvasTest, ClippingRect) {
SkBitmap bitmap;
- LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap);
+ LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap,
+ true);
SkRect rect;
rect.fLeft = 2;
rect.fTop = 2;
@@ -826,7 +829,8 @@ TEST_F(VectorCanvasTest, ClippingRect) {
TEST_F(VectorCanvasTest, ClippingPath) {
SkBitmap bitmap;
- LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap);
+ LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap,
+ true);
SkPath path;
path.addCircle(20, 20, 10);
vcanvas_->clipPath(path);
@@ -839,7 +843,8 @@ TEST_F(VectorCanvasTest, ClippingPath) {
TEST_F(VectorCanvasTest, ClippingCombined) {
SkBitmap bitmap;
- LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap);
+ LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap,
+ true);
SkRect rect;
rect.fLeft = 2;
@@ -860,7 +865,8 @@ TEST_F(VectorCanvasTest, ClippingCombined) {
TEST_F(VectorCanvasTest, ClippingIntersect) {
SkBitmap bitmap;
- LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap);
+ LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap,
+ true);
SkRect rect;
rect.fLeft = 2;
@@ -881,7 +887,8 @@ TEST_F(VectorCanvasTest, ClippingIntersect) {
TEST_F(VectorCanvasTest, ClippingClean) {
SkBitmap bitmap;
- LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap);
+ LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap,
+ true);
{
SkRegion old_region(pcanvas_->getTotalClip());
SkRect rect;
@@ -908,7 +915,8 @@ TEST_F(VectorCanvasTest, ClippingClean) {
TEST_F(VectorCanvasTest, DISABLED_Matrix) {
SkBitmap bitmap;
- LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap);
+ LoadPngFileToSkBitmap(test_file(L"..\\bitmaps\\bitmap_opaque.png"), &bitmap,
+ true);
{
vcanvas_->translate(15, 3);
pcanvas_->translate(15, 3);