OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CC_TEST_TEST_TEXTURE_H_ |
| 6 #define CC_TEST_TEST_TEXTURE_H_ |
| 7 |
5 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
6 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
7 #include "cc/base/cc_export.h" | |
8 #include "cc/resources/resource_format.h" | 10 #include "cc/resources/resource_format.h" |
9 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 11 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
10 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/size.h" |
11 | |
12 #ifndef CC_DEBUG_TEST_TEXTURE_H_ | |
13 #define CC_DEBUG_TEST_TEXTURE_H_ | |
14 | 13 |
15 namespace cc { | 14 namespace cc { |
16 | 15 |
17 size_t CC_EXPORT TextureSizeBytes(gfx::Size size, ResourceFormat format); | 16 size_t TextureSizeBytes(gfx::Size size, ResourceFormat format); |
18 | 17 |
19 struct CC_EXPORT TestTexture : public base::RefCounted<TestTexture> { | 18 struct TestTexture : public base::RefCounted<TestTexture> { |
20 TestTexture(); | 19 TestTexture(); |
21 | 20 |
22 void Reallocate(gfx::Size size, ResourceFormat format); | 21 void Reallocate(gfx::Size size, ResourceFormat format); |
23 | 22 |
24 gfx::Size size; | 23 gfx::Size size; |
25 ResourceFormat format; | 24 ResourceFormat format; |
26 scoped_ptr<uint8_t[]> data; | 25 scoped_ptr<uint8_t[]> data; |
27 | 26 |
28 // TODO(mvujovic): Replace this with a hash map of texture parameter names | 27 // TODO(mvujovic): Replace this with a hash map of texture parameter names |
29 // and values, which can hold this filter parameter value and more. | 28 // and values, which can hold this filter parameter value and more. |
30 WebKit::WGC3Denum filter; | 29 WebKit::WGC3Denum filter; |
31 | 30 |
32 private: | 31 private: |
33 friend class base::RefCounted<TestTexture>; | 32 friend class base::RefCounted<TestTexture>; |
34 ~TestTexture(); | 33 ~TestTexture(); |
35 }; | 34 }; |
36 | 35 |
37 } // namespace cc | 36 } // namespace cc |
38 | 37 |
39 #endif // CC_DEBUG_TEST_TEXTURE_H_ | 38 #endif // CC_TEST_TEST_TEXTURE_H_ |
OLD | NEW |