Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Side by Side Diff: Source/core/platform/graphics/chromium/ImageDecodingStoreTest.cpp

Issue 17999003: Deferred image decoding to support animated GIFs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: done Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698