OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2012 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2008, 2012 Apple Computer, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 static PassRefPtr<GeneratorGeneratedImage> create(PassRefPtr<Generator> gene
rator, const IntSize& size) | 43 static PassRefPtr<GeneratorGeneratedImage> create(PassRefPtr<Generator> gene
rator, const IntSize& size) |
44 { | 44 { |
45 return adoptRef(new GeneratorGeneratedImage(generator, size)); | 45 return adoptRef(new GeneratorGeneratedImage(generator, size)); |
46 } | 46 } |
47 | 47 |
48 virtual ~GeneratorGeneratedImage() | 48 virtual ~GeneratorGeneratedImage() |
49 { | 49 { |
50 m_cacheTimer.stop(); | 50 m_cacheTimer.stop(); |
51 } | 51 } |
52 | 52 |
53 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; | |
54 | |
55 protected: | 53 protected: |
56 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec
t& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode); | 54 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRec
t& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode); |
57 virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const A
ffineTransform& patternTransform, | 55 virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const A
ffineTransform& patternTransform, |
58 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator,
const FloatRect& destRect, BlendMode); | 56 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator,
const FloatRect& destRect, BlendMode); |
59 | 57 |
60 void invalidateCacheTimerFired(DeferrableOneShotTimer<GeneratorGeneratedImag
e>*); | 58 void invalidateCacheTimerFired(DeferrableOneShotTimer<GeneratorGeneratedImag
e>*); |
61 | 59 |
62 GeneratorGeneratedImage(PassRefPtr<Generator> generator, const IntSize& size
) | 60 GeneratorGeneratedImage(PassRefPtr<Generator> generator, const IntSize& size
) |
63 : m_generator(generator) | 61 : m_generator(generator) |
64 , m_cacheTimer(this, &GeneratorGeneratedImage::invalidateCacheTimerFired
, generatedImageCacheClearDelay) | 62 , m_cacheTimer(this, &GeneratorGeneratedImage::invalidateCacheTimerFired
, generatedImageCacheClearDelay) |
65 { | 63 { |
66 m_size = size; | 64 m_size = size; |
67 } | 65 } |
68 | 66 |
69 RefPtr<Generator> m_generator; | 67 RefPtr<Generator> m_generator; |
70 | 68 |
71 OwnPtr<ImageBuffer> m_cachedImageBuffer; | 69 OwnPtr<ImageBuffer> m_cachedImageBuffer; |
72 DeferrableOneShotTimer<GeneratorGeneratedImage> m_cacheTimer; | 70 DeferrableOneShotTimer<GeneratorGeneratedImage> m_cacheTimer; |
73 IntSize m_cachedAdjustedSize; | 71 IntSize m_cachedAdjustedSize; |
74 unsigned m_cachedGeneratorHash; | 72 unsigned m_cachedGeneratorHash; |
75 }; | 73 }; |
76 | 74 |
77 } | 75 } |
78 | 76 |
79 #endif | 77 #endif |
OLD | NEW |