| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 public: | 53 public: |
| 54 static PassRefPtr<TestImage> Create(sk_sp<SkImage> image) { | 54 static PassRefPtr<TestImage> Create(sk_sp<SkImage> image) { |
| 55 return AdoptRef(new TestImage(image)); | 55 return AdoptRef(new TestImage(image)); |
| 56 } | 56 } |
| 57 | 57 |
| 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(image_); | 63 DCHECK(image_); |
| 64 | 64 |
| 65 return IntSize(image_->width(), image_->height()); | 65 return IntSize(image_->width(), image_->height()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 sk_sp<SkImage> ImageForCurrentFrame() override { return image_; } | 68 sk_sp<SkImage> ImageForCurrentFrame() override { return image_; } |
| 69 | 69 |
| 70 bool CurrentFrameKnownToBeOpaque( | 70 bool CurrentFrameKnownToBeOpaque( |
| 71 MetadataMode = kUseCurrentMetadata) override { | 71 MetadataMode = kUseCurrentMetadata) override { |
| 72 return false; | 72 return false; |
| 73 } | 73 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 test_image.Get(), kDoNotRespectImageOrientation, 1, kInterpolationNone); | 174 test_image.Get(), kDoNotRespectImageOrientation, 1, kInterpolationNone); |
| 175 ASSERT_TRUE(drag_image); | 175 ASSERT_TRUE(drag_image); |
| 176 drag_image->Scale(2, 2); | 176 drag_image->Scale(2, 2); |
| 177 const SkBitmap& drag_bitmap = drag_image->Bitmap(); | 177 const SkBitmap& drag_bitmap = drag_image->Bitmap(); |
| 178 for (int x = 0; x < drag_bitmap.width(); ++x) | 178 for (int x = 0; x < drag_bitmap.width(); ++x) |
| 179 for (int y = 0; y < drag_bitmap.height(); ++y) | 179 for (int y = 0; y < drag_bitmap.height(); ++y) |
| 180 EXPECT_EQ(expected_bitmap.getColor(x, y), drag_bitmap.getColor(x, y)); | 180 EXPECT_EQ(expected_bitmap.getColor(x, y), drag_bitmap.getColor(x, y)); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace blink | 183 } // namespace blink |
| OLD | NEW |