OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 #ifndef LayerTextureSubImage_h | 6 #ifndef LayerTextureSubImage_h |
7 #define LayerTextureSubImage_h | 7 #define LayerTextureSubImage_h |
8 | 8 |
9 #include "GraphicsTypes3D.h" | 9 #include "third_party/khronos/GLES2/gl2.h" |
10 #include "IntRect.h" | 10 #include "IntRect.h" |
11 #include "IntSize.h" | 11 #include "IntSize.h" |
12 #include <wtf/OwnArrayPtr.h> | 12 #include <wtf/OwnArrayPtr.h> |
13 | 13 |
14 namespace WebKit { | 14 namespace WebKit { |
15 class WebGraphicsContext3D; | 15 class WebGraphicsContext3D; |
16 } | 16 } |
17 | 17 |
18 namespace cc { | 18 namespace cc { |
19 | 19 |
20 class LayerTextureSubImage { | 20 class LayerTextureSubImage { |
21 public: | 21 public: |
22 explicit LayerTextureSubImage(bool useMapSubForUpload); | 22 explicit LayerTextureSubImage(bool useMapSubForUpload); |
23 ~LayerTextureSubImage(); | 23 ~LayerTextureSubImage(); |
24 | 24 |
25 void upload(const uint8_t* image, const IntRect& imageRect, | 25 void upload(const uint8_t* image, const IntRect& imageRect, |
26 const IntRect& sourceRect, const IntSize& destOffset, | 26 const IntRect& sourceRect, const IntSize& destOffset, |
27 GC3Denum format, WebKit::WebGraphicsContext3D*); | 27 GLenum format, WebKit::WebGraphicsContext3D*); |
28 | 28 |
29 private: | 29 private: |
30 void uploadWithTexSubImage(const uint8_t* image, const IntRect& imageRect, | 30 void uploadWithTexSubImage(const uint8_t* image, const IntRect& imageRect, |
31 const IntRect& sourceRect, const IntSize& destOff
set, | 31 const IntRect& sourceRect, const IntSize& destOff
set, |
32 GC3Denum format, WebKit::WebGraphicsContext3D*); | 32 GLenum format, WebKit::WebGraphicsContext3D*); |
33 void uploadWithMapTexSubImage(const uint8_t* image, const IntRect& imageRect
, | 33 void uploadWithMapTexSubImage(const uint8_t* image, const IntRect& imageRect
, |
34 const IntRect& sourceRect, const IntSize& dest
Offset, | 34 const IntRect& sourceRect, const IntSize& dest
Offset, |
35 GC3Denum format, WebKit::WebGraphicsContext3D*
); | 35 GLenum format, WebKit::WebGraphicsContext3D*); |
36 | 36 |
37 bool m_useMapTexSubImage; | 37 bool m_useMapTexSubImage; |
38 size_t m_subImageSize; | 38 size_t m_subImageSize; |
39 OwnArrayPtr<uint8_t> m_subImage; | 39 OwnArrayPtr<uint8_t> m_subImage; |
40 }; | 40 }; |
41 | 41 |
42 } // namespace cc | 42 } // namespace cc |
43 #endif // LayerTextureSubImage_h | 43 #endif // LayerTextureSubImage_h |
OLD | NEW |