| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 static PassRefPtr<TestImage> create(const IntSize& size) { | 58 static PassRefPtr<TestImage> create(const IntSize& size) { |
| 59 return adoptRef(new TestImage(size)); | 59 return adoptRef(new TestImage(size)); |
| 60 } | 60 } |
| 61 | 61 |
| 62 IntSize size() const override { | 62 IntSize size() const override { |
| 63 ASSERT(m_image); | 63 ASSERT(m_image); |
| 64 | 64 |
| 65 return IntSize(m_image->width(), m_image->height()); | 65 return IntSize(m_image->width(), m_image->height()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 sk_sp<SkImage> imageForCurrentFrame(const ColorBehavior&) override { | 68 sk_sp<SkImage> imageForCurrentFrame() override { return m_image; } |
| 69 return m_image; | |
| 70 } | |
| 71 | 69 |
| 72 bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { | 70 bool currentFrameKnownToBeOpaque(MetadataMode = UseCurrentMetadata) override { |
| 73 return false; | 71 return false; |
| 74 } | 72 } |
| 75 | 73 |
| 76 void destroyDecodedData() override { | 74 void destroyDecodedData() override { |
| 77 // Image pure virtual stub. | 75 // Image pure virtual stub. |
| 78 } | 76 } |
| 79 | 77 |
| 80 void draw(PaintCanvas*, | 78 void draw(PaintCanvas*, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 { | 219 { |
| 222 SkAutoLockPixels lock1(dragBitmap); | 220 SkAutoLockPixels lock1(dragBitmap); |
| 223 SkAutoLockPixels lock2(expectedBitmap); | 221 SkAutoLockPixels lock2(expectedBitmap); |
| 224 for (int x = 0; x < dragBitmap.width(); ++x) | 222 for (int x = 0; x < dragBitmap.width(); ++x) |
| 225 for (int y = 0; y < dragBitmap.height(); ++y) | 223 for (int y = 0; y < dragBitmap.height(); ++y) |
| 226 EXPECT_EQ(expectedBitmap.getColor(x, y), dragBitmap.getColor(x, y)); | 224 EXPECT_EQ(expectedBitmap.getColor(x, y), dragBitmap.getColor(x, y)); |
| 227 } | 225 } |
| 228 } | 226 } |
| 229 | 227 |
| 230 } // namespace blink | 228 } // namespace blink |
| OLD | NEW |