| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 virtual void frameBufferRequested() | 88 virtual void frameBufferRequested() |
| 89 { | 89 { |
| 90 ++m_frameBufferRequestCount; | 90 ++m_frameBufferRequestCount; |
| 91 } | 91 } |
| 92 | 92 |
| 93 virtual ImageFrame::FrameStatus frameStatus() | 93 virtual ImageFrame::FrameStatus frameStatus() |
| 94 { | 94 { |
| 95 return m_frameStatus; | 95 return m_frameStatus; |
| 96 } | 96 } |
| 97 | 97 |
| 98 virtual size_t frameCount() { return 1; } |
| 99 virtual int repetitionCount() const { return cAnimationNone; } |
| 100 virtual float frameDuration() const { return 0; } |
| 101 |
| 98 protected: | 102 protected: |
| 99 PassOwnPtr<ScaledImageFragment> createCompleteImage(const SkISize& size) | 103 PassOwnPtr<ScaledImageFragment> createCompleteImage(const SkISize& size) |
| 100 { | 104 { |
| 101 SkBitmap bitmap; | 105 SkBitmap bitmap; |
| 102 bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height(
)); | 106 bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height(
)); |
| 103 bitmap.allocPixels(); | 107 bitmap.allocPixels(); |
| 104 return ScaledImageFragment::createComplete(size, 0, bitmap); | 108 return ScaledImageFragment::createComplete(size, 0, bitmap); |
| 105 } | 109 } |
| 106 | 110 |
| 107 void addNewData() | 111 void addNewData() |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 386 |
| 383 ImageDecoder* tempDecoder = 0; | 387 ImageDecoder* tempDecoder = 0; |
| 384 EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), f
ullSize(), &tempDecoder)); | 388 EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), f
ullSize(), &tempDecoder)); |
| 385 ASSERT_TRUE(tempDecoder); | 389 ASSERT_TRUE(tempDecoder); |
| 386 EXPECT_NE(tempDecoder->frameBufferAtIndex(0)->getSkBitmap().getPixels(), tem
pImage->bitmap().getPixels()); | 390 EXPECT_NE(tempDecoder->frameBufferAtIndex(0)->getSkBitmap().getPixels(), tem
pImage->bitmap().getPixels()); |
| 387 ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage); | 391 ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage); |
| 388 ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), tempDecoder
); | 392 ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), tempDecoder
); |
| 389 } | 393 } |
| 390 | 394 |
| 391 } // namespace | 395 } // namespace |
| OLD | NEW |