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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 using skia::LazyPixelRef; | 39 using skia::LazyPixelRef; |
40 | 40 |
41 class SkData; | 41 class SkData; |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 class ImageFrameGenerator; | 45 class ImageFrameGenerator; |
46 class ScaledImageFragment; | 46 class ScaledImageFragment; |
47 | 47 |
48 class LazyDecodingPixelRef : public LazyPixelRef { | 48 class LazyDecodingPixelRef FINAL : public LazyPixelRef { |
49 public: | 49 public: |
50 LazyDecodingPixelRef(const SkImageInfo&, PassRefPtr<ImageFrameGenerator>, si
ze_t index); | 50 LazyDecodingPixelRef(const SkImageInfo&, PassRefPtr<ImageFrameGenerator>, si
ze_t index); |
51 virtual ~LazyDecodingPixelRef(); | 51 virtual ~LazyDecodingPixelRef(); |
52 | 52 |
53 SK_DECLARE_UNFLATTENABLE_OBJECT() | 53 SK_DECLARE_UNFLATTENABLE_OBJECT() |
54 | 54 |
55 PassRefPtr<ImageFrameGenerator> frameGenerator() const { return m_frameGener
ator; } | 55 PassRefPtr<ImageFrameGenerator> frameGenerator() const { return m_frameGener
ator; } |
56 size_t frameIndex() const { return m_frameIndex; } | 56 size_t frameIndex() const { return m_frameIndex; } |
57 | 57 |
58 // Returns true if the image might already be decoded in the cache. | 58 // Returns true if the image might already be decoded in the cache. |
59 // Optimistic version of PrepareToDecode; requires less locking. | 59 // Optimistic version of PrepareToDecode; requires less locking. |
60 virtual bool MaybeDecoded(); | 60 virtual bool MaybeDecoded() OVERRIDE; |
61 virtual bool PrepareToDecode(const LazyPixelRef::PrepareParams&); | 61 virtual bool PrepareToDecode(const LazyPixelRef::PrepareParams&) OVERRIDE; |
62 virtual void Decode(); | 62 virtual void Decode() OVERRIDE; |
63 | 63 |
64 protected: | 64 protected: |
65 // SkPixelRef implementation. | 65 // SkPixelRef implementation. |
66 virtual void* onLockPixels(SkColorTable**); | 66 virtual void* onLockPixels(SkColorTable**) OVERRIDE; |
67 virtual void onUnlockPixels(); | 67 virtual void onUnlockPixels() OVERRIDE; |
68 virtual bool onLockPixelsAreWritable() const; | 68 virtual bool onLockPixelsAreWritable() const OVERRIDE; |
69 | 69 |
70 virtual SkData* onRefEncodedData() SK_OVERRIDE; | 70 virtual SkData* onRefEncodedData() SK_OVERRIDE; |
71 | 71 |
72 private: | 72 private: |
73 RefPtr<ImageFrameGenerator> m_frameGenerator; | 73 RefPtr<ImageFrameGenerator> m_frameGenerator; |
74 size_t m_frameIndex; | 74 size_t m_frameIndex; |
75 | 75 |
76 const ScaledImageFragment* m_lockedImageResource; | 76 const ScaledImageFragment* m_lockedImageResource; |
77 PlatformInstrumentation::LazyPixelRefTracker m_objectTracker; | 77 PlatformInstrumentation::LazyPixelRefTracker m_objectTracker; |
78 }; | 78 }; |
79 | 79 |
80 } // namespace WebCore | 80 } // namespace WebCore |
81 | 81 |
82 #endif // LazyDecodingPixelRef_h_ | 82 #endif // LazyDecodingPixelRef_h_ |
OLD | NEW |