| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 { | 61 { |
| 62 // Decoder is never used by ImageDecodingStore. | 62 // Decoder is never used by ImageDecodingStore. |
| 63 ASSERT_TRUE(false); | 63 ASSERT_TRUE(false); |
| 64 } | 64 } |
| 65 | 65 |
| 66 virtual ImageFrame::FrameStatus frameStatus() | 66 virtual ImageFrame::FrameStatus frameStatus() |
| 67 { | 67 { |
| 68 return ImageFrame::FramePartial; | 68 return ImageFrame::FramePartial; |
| 69 } | 69 } |
| 70 | 70 |
| 71 virtual size_t frameCount() { return 1; } |
| 72 virtual int repetitionCount() const { return cAnimationNone; } |
| 73 virtual float frameDuration() const { return 0; } |
| 74 |
| 71 protected: | 75 protected: |
| 72 PassOwnPtr<ScaledImageFragment> createCompleteImage(const SkISize& size, boo
l discardable = false, size_t index = 0) | 76 PassOwnPtr<ScaledImageFragment> createCompleteImage(const SkISize& size, boo
l discardable = false, size_t index = 0) |
| 73 { | 77 { |
| 74 SkBitmap bitmap; | 78 SkBitmap bitmap; |
| 75 bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height(
)); | 79 bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height(
)); |
| 76 if (!discardable) | 80 if (!discardable) |
| 77 bitmap.allocPixels(); | 81 bitmap.allocPixels(); |
| 78 else | 82 else |
| 79 bitmap.setPixelRef(new MockDiscardablePixelRef())->unref(); | 83 bitmap.setPixelRef(new MockDiscardablePixelRef())->unref(); |
| 80 return ScaledImageFragment::createComplete(size, index, bitmap); | 84 return ScaledImageFragment::createComplete(size, index, bitmap); |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 const ScaledImageFragment* cachedImage = lockCache(SkISize::Make(1, 1)); | 451 const ScaledImageFragment* cachedImage = lockCache(SkISize::Make(1, 1)); |
| 448 ASSERT_TRUE(cachedImage); | 452 ASSERT_TRUE(cachedImage); |
| 449 ImageDecodingStore::instance()->clear(); | 453 ImageDecodingStore::instance()->clear(); |
| 450 EXPECT_EQ(1u, ImageDecodingStore::instance()->cacheEntries()); | 454 EXPECT_EQ(1u, ImageDecodingStore::instance()->cacheEntries()); |
| 451 | 455 |
| 452 unlockCache(cachedImage); | 456 unlockCache(cachedImage); |
| 453 EXPECT_EQ(1u, ImageDecodingStore::instance()->cacheEntries()); | 457 EXPECT_EQ(1u, ImageDecodingStore::instance()->cacheEntries()); |
| 454 } | 458 } |
| 455 | 459 |
| 456 } // namespace | 460 } // namespace |
| OLD | NEW |