OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 12 matching lines...) Expand all Loading... |
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 | 26 |
27 #ifndef LayerTextureUpdater_h | 27 #ifndef LayerTextureUpdater_h |
28 #define LayerTextureUpdater_h | 28 #define LayerTextureUpdater_h |
29 | 29 |
30 #if USE(ACCELERATED_COMPOSITING) | 30 #if USE(ACCELERATED_COMPOSITING) |
31 | 31 |
32 #include "GraphicsTypes3D.h" | 32 #include "GraphicsTypes3D.h" |
33 #include <wtf/Noncopyable.h> | 33 #include <wtf/RefCounted.h> |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 class GraphicsContext3D; | 37 class GraphicsContext3D; |
38 class IntRect; | 38 class IntRect; |
39 class IntSize; | 39 class IntSize; |
40 class ManagedTexture; | 40 class ManagedTexture; |
41 | 41 |
42 class LayerTextureUpdater { | 42 class LayerTextureUpdater : public RefCounted<LayerTextureUpdater> { |
43 WTF_MAKE_NONCOPYABLE(LayerTextureUpdater); | |
44 public: | 43 public: |
45 LayerTextureUpdater() { } | |
46 virtual ~LayerTextureUpdater() { } | 44 virtual ~LayerTextureUpdater() { } |
47 | 45 |
48 enum Orientation { | 46 enum Orientation { |
49 BottomUpOrientation, | 47 BottomUpOrientation, |
50 TopDownOrientation, | 48 TopDownOrientation, |
51 InvalidOrientation, | 49 InvalidOrientation, |
52 }; | 50 }; |
53 enum SampledTexelFormat { | 51 enum SampledTexelFormat { |
54 SampledTexelFormatRGBA, | 52 SampledTexelFormatRGBA, |
55 SampledTexelFormatBGRA, | 53 SampledTexelFormatBGRA, |
56 SampledTexelFormatInvalid, | 54 SampledTexelFormatInvalid, |
57 }; | 55 }; |
58 // Returns the orientation of the texture uploaded by this interface. | 56 // Returns the orientation of the texture uploaded by this interface. |
59 virtual Orientation orientation() = 0; | 57 virtual Orientation orientation() = 0; |
60 // Returns the format of the texel uploaded by this interface. | 58 // Returns the format of the texel uploaded by this interface. |
61 // This format should not be confused by texture internal format. | 59 // This format should not be confused by texture internal format. |
62 // This format specifies the component order in the sampled texel. | 60 // This format specifies the component order in the sampled texel. |
63 // If the format is TexelFormatBGRA, vec4.x is blue and vec4.z is red. | 61 // If the format is TexelFormatBGRA, vec4.x is blue and vec4.z is red. |
64 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) = 0; | 62 virtual SampledTexelFormat sampledTexelFormat(GC3Denum textureFormat) = 0; |
65 virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tile
Size, int borderTexels) = 0; | 63 virtual void prepareToUpdate(const IntRect& contentRect, const IntSize& tile
Size, int borderTexels) = 0; |
66 virtual void updateTextureRect(GraphicsContext3D*, ManagedTexture*, const In
tRect& sourceRect, const IntRect& destRect) = 0; | 64 virtual void updateTextureRect(GraphicsContext3D*, ManagedTexture*, const In
tRect& sourceRect, const IntRect& destRect) = 0; |
67 }; | 65 }; |
68 | 66 |
69 } // namespace WebCore | 67 } // namespace WebCore |
70 #endif // USE(ACCELERATED_COMPOSITING) | 68 #endif // USE(ACCELERATED_COMPOSITING) |
71 #endif // LayerTextureUpdater_h | 69 #endif // LayerTextureUpdater_h |
OLD | NEW |