diff options
author | Mathias Agopian | 2013-04-01 17:17:55 -0500 |
---|---|---|
committer | Mathias Agopian | 2013-04-01 18:50:43 -0500 |
commit | 9857d99eecc389389da261a72461322d5cfb8eeb (patch) | |
tree | 2de3f96ffa093a633b93b246902bb6a506ba053f /libpixelflinger | |
parent | d67bbab6d873c073fa5c3bdb93e8f32106898123 (diff) | |
download | platform-system-core-9857d99eecc389389da261a72461322d5cfb8eeb.tar.gz platform-system-core-9857d99eecc389389da261a72461322d5cfb8eeb.tar.xz platform-system-core-9857d99eecc389389da261a72461322d5cfb8eeb.zip |
move tinyutils into its own namespace
I was fed-up with the constant conflicts in Eclipse
with the "libutils" version.
Also fix a few copyright notices.
Change-Id: I8ffcb845af4b5d0d178f5565f64dfcfbfa27fcd6
Diffstat (limited to 'libpixelflinger')
25 files changed, 185 insertions, 130 deletions
diff --git a/libpixelflinger/Android.mk b/libpixelflinger/Android.mk index 488003f2a..85d2c9cf0 100644 --- a/libpixelflinger/Android.mk +++ b/libpixelflinger/Android.mk | |||
@@ -16,8 +16,8 @@ PIXELFLINGER_SRC_FILES:= \ | |||
16 | codeflinger/blending.cpp \ | 16 | codeflinger/blending.cpp \ |
17 | codeflinger/texturing.cpp \ | 17 | codeflinger/texturing.cpp \ |
18 | codeflinger/disassem.c \ | 18 | codeflinger/disassem.c \ |
19 | tinyutils/SharedBuffer.cpp \ | 19 | codeflinger/tinyutils/SharedBuffer.cpp \ |
20 | tinyutils/VectorImpl.cpp \ | 20 | codeflinger/tinyutils/VectorImpl.cpp \ |
21 | fixed.cpp.arm \ | 21 | fixed.cpp.arm \ |
22 | picker.cpp.arm \ | 22 | picker.cpp.arm \ |
23 | pixelflinger.cpp.arm \ | 23 | pixelflinger.cpp.arm \ |
@@ -52,13 +52,6 @@ endif | |||
52 | 52 | ||
53 | LOCAL_SHARED_LIBRARIES := libcutils | 53 | LOCAL_SHARED_LIBRARIES := libcutils |
54 | 54 | ||
55 | ifneq ($(TARGET_ARCH),arm) | ||
56 | # Required to define logging functions on the simulator. | ||
57 | # TODO: move the simulator logging functions into libcutils with | ||
58 | # the rest of the basic log stuff. | ||
59 | LOCAL_SHARED_LIBRARIES += libutils | ||
60 | endif | ||
61 | |||
62 | # | 55 | # |
63 | # Shared library | 56 | # Shared library |
64 | # | 57 | # |
diff --git a/libpixelflinger/codeflinger/ARMAssembler.cpp b/libpixelflinger/codeflinger/ARMAssembler.cpp index c4f42f5bd..607ed3c1f 100644 --- a/libpixelflinger/codeflinger/ARMAssembler.cpp +++ b/libpixelflinger/codeflinger/ARMAssembler.cpp | |||
@@ -28,9 +28,9 @@ | |||
28 | 28 | ||
29 | #include <private/pixelflinger/ggl_context.h> | 29 | #include <private/pixelflinger/ggl_context.h> |
30 | 30 | ||
31 | #include "codeflinger/ARMAssembler.h" | 31 | #include "ARMAssembler.h" |
32 | #include "codeflinger/CodeCache.h" | 32 | #include "CodeCache.h" |
33 | #include "codeflinger/disassem.h" | 33 | #include "disassem.h" |
34 | 34 | ||
35 | // ---------------------------------------------------------------------------- | 35 | // ---------------------------------------------------------------------------- |
36 | 36 | ||
diff --git a/libpixelflinger/codeflinger/ARMAssembler.h b/libpixelflinger/codeflinger/ARMAssembler.h index 06c66dd8b..c03dd9a39 100644 --- a/libpixelflinger/codeflinger/ARMAssembler.h +++ b/libpixelflinger/codeflinger/ARMAssembler.h | |||
@@ -25,9 +25,8 @@ | |||
25 | #include "tinyutils/KeyedVector.h" | 25 | #include "tinyutils/KeyedVector.h" |
26 | #include "tinyutils/smartpointer.h" | 26 | #include "tinyutils/smartpointer.h" |
27 | 27 | ||
28 | #include "tinyutils/smartpointer.h" | 28 | #include "ARMAssemblerInterface.h" |
29 | #include "codeflinger/ARMAssemblerInterface.h" | 29 | #include "CodeCache.h" |
30 | #include "codeflinger/CodeCache.h" | ||
31 | 30 | ||
32 | namespace android { | 31 | namespace android { |
33 | 32 | ||
diff --git a/libpixelflinger/codeflinger/ARMAssemblerInterface.cpp b/libpixelflinger/codeflinger/ARMAssemblerInterface.cpp index 82180eef0..073633cd1 100644 --- a/libpixelflinger/codeflinger/ARMAssemblerInterface.cpp +++ b/libpixelflinger/codeflinger/ARMAssemblerInterface.cpp | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <sys/types.h> | 22 | #include <sys/types.h> |
23 | 23 | ||
24 | #include <cutils/log.h> | 24 | #include <cutils/log.h> |
25 | #include "codeflinger/ARMAssemblerInterface.h" | 25 | #include "ARMAssemblerInterface.h" |
26 | 26 | ||
27 | namespace android { | 27 | namespace android { |
28 | 28 | ||
diff --git a/libpixelflinger/codeflinger/ARMAssemblerProxy.cpp b/libpixelflinger/codeflinger/ARMAssemblerProxy.cpp index 7feed622b..1c7bc76e4 100644 --- a/libpixelflinger/codeflinger/ARMAssemblerProxy.cpp +++ b/libpixelflinger/codeflinger/ARMAssemblerProxy.cpp | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <stdint.h> | 19 | #include <stdint.h> |
20 | #include <sys/types.h> | 20 | #include <sys/types.h> |
21 | 21 | ||
22 | #include "codeflinger/ARMAssemblerProxy.h" | 22 | #include "ARMAssemblerProxy.h" |
23 | 23 | ||
24 | namespace android { | 24 | namespace android { |
25 | 25 | ||
diff --git a/libpixelflinger/codeflinger/ARMAssemblerProxy.h b/libpixelflinger/codeflinger/ARMAssemblerProxy.h index 5e3f763bc..70cb4645d 100644 --- a/libpixelflinger/codeflinger/ARMAssemblerProxy.h +++ b/libpixelflinger/codeflinger/ARMAssemblerProxy.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <stdint.h> | 22 | #include <stdint.h> |
23 | #include <sys/types.h> | 23 | #include <sys/types.h> |
24 | 24 | ||
25 | #include "codeflinger/ARMAssemblerInterface.h" | 25 | #include "ARMAssemblerInterface.h" |
26 | 26 | ||
27 | namespace android { | 27 | namespace android { |
28 | 28 | ||
diff --git a/libpixelflinger/codeflinger/CodeCache.cpp b/libpixelflinger/codeflinger/CodeCache.cpp index f9ae00ac7..58fde7eeb 100644 --- a/libpixelflinger/codeflinger/CodeCache.cpp +++ b/libpixelflinger/codeflinger/CodeCache.cpp | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <cutils/log.h> | 28 | #include <cutils/log.h> |
29 | 29 | ||
30 | 30 | ||
31 | #include "codeflinger/CodeCache.h" | 31 | #include "CodeCache.h" |
32 | 32 | ||
33 | namespace android { | 33 | namespace android { |
34 | 34 | ||
diff --git a/libpixelflinger/codeflinger/CodeCache.h b/libpixelflinger/codeflinger/CodeCache.h index 54fd69b04..fa67dd072 100644 --- a/libpixelflinger/codeflinger/CodeCache.h +++ b/libpixelflinger/codeflinger/CodeCache.h | |||
@@ -28,6 +28,8 @@ | |||
28 | 28 | ||
29 | namespace android { | 29 | namespace android { |
30 | 30 | ||
31 | using namespace tinyutils; | ||
32 | |||
31 | // ---------------------------------------------------------------------------- | 33 | // ---------------------------------------------------------------------------- |
32 | 34 | ||
33 | class AssemblyKeyBase { | 35 | class AssemblyKeyBase { |
diff --git a/libpixelflinger/codeflinger/GGLAssembler.cpp b/libpixelflinger/codeflinger/GGLAssembler.cpp index 1ddf93d57..0cb042eb9 100644 --- a/libpixelflinger/codeflinger/GGLAssembler.cpp +++ b/libpixelflinger/codeflinger/GGLAssembler.cpp | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <sys/types.h> | 24 | #include <sys/types.h> |
25 | #include <cutils/log.h> | 25 | #include <cutils/log.h> |
26 | 26 | ||
27 | #include "codeflinger/GGLAssembler.h" | 27 | #include "GGLAssembler.h" |
28 | 28 | ||
29 | namespace android { | 29 | namespace android { |
30 | 30 | ||
diff --git a/libpixelflinger/codeflinger/GGLAssembler.h b/libpixelflinger/codeflinger/GGLAssembler.h index dd5f48ee9..d99368404 100644 --- a/libpixelflinger/codeflinger/GGLAssembler.h +++ b/libpixelflinger/codeflinger/GGLAssembler.h | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include <private/pixelflinger/ggl_context.h> | 25 | #include <private/pixelflinger/ggl_context.h> |
26 | 26 | ||
27 | #include "codeflinger/ARMAssemblerProxy.h" | 27 | #include "ARMAssemblerProxy.h" |
28 | 28 | ||
29 | 29 | ||
30 | namespace android { | 30 | namespace android { |
diff --git a/libpixelflinger/codeflinger/MIPSAssembler.cpp b/libpixelflinger/codeflinger/MIPSAssembler.cpp index 7888a0e4e..a88d2fe00 100644 --- a/libpixelflinger/codeflinger/MIPSAssembler.cpp +++ b/libpixelflinger/codeflinger/MIPSAssembler.cpp | |||
@@ -61,9 +61,9 @@ | |||
61 | 61 | ||
62 | #include <private/pixelflinger/ggl_context.h> | 62 | #include <private/pixelflinger/ggl_context.h> |
63 | 63 | ||
64 | #include "codeflinger/MIPSAssembler.h" | 64 | #include "MIPSAssembler.h" |
65 | #include "codeflinger/CodeCache.h" | 65 | #include "CodeCache.h" |
66 | #include "codeflinger/mips_disassem.h" | 66 | #include "mips_disassem.h" |
67 | 67 | ||
68 | // Choose MIPS arch variant following gcc flags | 68 | // Choose MIPS arch variant following gcc flags |
69 | #if defined(__mips__) && __mips==32 && __mips_isa_rev>=2 | 69 | #if defined(__mips__) && __mips==32 && __mips_isa_rev>=2 |
diff --git a/libpixelflinger/codeflinger/MIPSAssembler.h b/libpixelflinger/codeflinger/MIPSAssembler.h index d8e8165e9..430ab064c 100644 --- a/libpixelflinger/codeflinger/MIPSAssembler.h +++ b/libpixelflinger/codeflinger/MIPSAssembler.h | |||
@@ -21,12 +21,12 @@ | |||
21 | #include <stdint.h> | 21 | #include <stdint.h> |
22 | #include <sys/types.h> | 22 | #include <sys/types.h> |
23 | 23 | ||
24 | #include <utils/Vector.h> | 24 | #include "tinyutils/KeyedVector.h" |
25 | #include <utils/KeyedVector.h> | 25 | #include "tinyutils/Vector.h" |
26 | |||
27 | #include "tinyutils/smartpointer.h" | 26 | #include "tinyutils/smartpointer.h" |
28 | #include "codeflinger/ARMAssemblerInterface.h" | 27 | |
29 | #include "codeflinger/CodeCache.h" | 28 | #include "ARMAssemblerInterface.h" |
29 | #include "CodeCache.h" | ||
30 | 30 | ||
31 | namespace android { | 31 | namespace android { |
32 | 32 | ||
diff --git a/libpixelflinger/codeflinger/blending.cpp b/libpixelflinger/codeflinger/blending.cpp index c90eaa0f5..b20219ced 100644 --- a/libpixelflinger/codeflinger/blending.cpp +++ b/libpixelflinger/codeflinger/blending.cpp | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | #include <cutils/log.h> | 24 | #include <cutils/log.h> |
25 | 25 | ||
26 | #include "codeflinger/GGLAssembler.h" | 26 | #include "GGLAssembler.h" |
27 | 27 | ||
28 | 28 | ||
29 | namespace android { | 29 | namespace android { |
diff --git a/libpixelflinger/codeflinger/load_store.cpp b/libpixelflinger/codeflinger/load_store.cpp index 146fa52ea..0a46eaa3c 100644 --- a/libpixelflinger/codeflinger/load_store.cpp +++ b/libpixelflinger/codeflinger/load_store.cpp | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <assert.h> | 18 | #include <assert.h> |
19 | #include <stdio.h> | 19 | #include <stdio.h> |
20 | #include <cutils/log.h> | 20 | #include <cutils/log.h> |
21 | #include "codeflinger/GGLAssembler.h" | 21 | #include "GGLAssembler.h" |
22 | 22 | ||
23 | #ifdef __ARM_ARCH__ | 23 | #ifdef __ARM_ARCH__ |
24 | #include <machine/cpu-features.h> | 24 | #include <machine/cpu-features.h> |
diff --git a/libpixelflinger/codeflinger/texturing.cpp b/libpixelflinger/codeflinger/texturing.cpp index 4d5a50f1d..9e3d2172d 100644 --- a/libpixelflinger/codeflinger/texturing.cpp +++ b/libpixelflinger/codeflinger/texturing.cpp | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | #include <cutils/log.h> | 24 | #include <cutils/log.h> |
25 | 25 | ||
26 | #include "codeflinger/GGLAssembler.h" | 26 | #include "GGLAssembler.h" |
27 | 27 | ||
28 | #ifdef __ARM_ARCH__ | 28 | #ifdef __ARM_ARCH__ |
29 | #include <machine/cpu-features.h> | 29 | #include <machine/cpu-features.h> |
diff --git a/libpixelflinger/tinyutils/Errors.h b/libpixelflinger/codeflinger/tinyutils/Errors.h index b9fd5f4fc..47ae9d79e 100644 --- a/libpixelflinger/tinyutils/Errors.h +++ b/libpixelflinger/codeflinger/tinyutils/Errors.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007 The Android Open Source Project | 2 | * Copyright 2007 The Android Open Source Project |
3 | * | 3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. | 5 | * you may not use this file except in compliance with the License. |
@@ -14,13 +14,14 @@ | |||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #ifndef ANDROID_ERRORS_H | 17 | #ifndef ANDROID_PIXELFLINGER_ERRORS_H |
18 | #define ANDROID_ERRORS_H | 18 | #define ANDROID_PIXELFLINGER_ERRORS_H |
19 | 19 | ||
20 | #include <sys/types.h> | 20 | #include <sys/types.h> |
21 | #include <errno.h> | 21 | #include <errno.h> |
22 | 22 | ||
23 | namespace android { | 23 | namespace android { |
24 | namespace tinyutils { | ||
24 | 25 | ||
25 | // use this type to return error codes | 26 | // use this type to return error codes |
26 | typedef int32_t status_t; | 27 | typedef int32_t status_t; |
@@ -31,32 +32,17 @@ typedef int32_t status_t; | |||
31 | */ | 32 | */ |
32 | 33 | ||
33 | enum { | 34 | enum { |
34 | OK = 0, // Everything's swell. | ||
35 | NO_ERROR = 0, // No errors. | 35 | NO_ERROR = 0, // No errors. |
36 | |||
37 | UNKNOWN_ERROR = 0x80000000, | ||
38 | |||
39 | NO_MEMORY = -ENOMEM, | 36 | NO_MEMORY = -ENOMEM, |
40 | INVALID_OPERATION = -ENOSYS, | ||
41 | BAD_VALUE = -EINVAL, | 37 | BAD_VALUE = -EINVAL, |
42 | BAD_TYPE = 0x80000001, | ||
43 | NAME_NOT_FOUND = -ENOENT, | ||
44 | PERMISSION_DENIED = -EPERM, | ||
45 | NO_INIT = -ENODEV, | ||
46 | ALREADY_EXISTS = -EEXIST, | ||
47 | DEAD_OBJECT = -EPIPE, | ||
48 | FAILED_TRANSACTION = 0x80000002, | ||
49 | JPARKS_BROKE_IT = -EPIPE, | ||
50 | BAD_INDEX = -EOVERFLOW, | 38 | BAD_INDEX = -EOVERFLOW, |
51 | NOT_ENOUGH_DATA = -ENODATA, | 39 | NAME_NOT_FOUND = -ENOENT, |
52 | WOULD_BLOCK = -EWOULDBLOCK, | ||
53 | TIMED_OUT = -ETIME, | ||
54 | UNKNOWN_TRANSACTION = -EBADMSG, | ||
55 | }; | 40 | }; |
56 | 41 | ||
57 | 42 | ||
58 | }; // namespace android | 43 | } // namespace tinyutils |
44 | } // namespace android | ||
59 | 45 | ||
60 | // --------------------------------------------------------------------------- | 46 | // --------------------------------------------------------------------------- |
61 | 47 | ||
62 | #endif // ANDROID_ERRORS_H | 48 | #endif // ANDROID_PIXELFLINGER_ERRORS_H |
diff --git a/libpixelflinger/tinyutils/KeyedVector.h b/libpixelflinger/codeflinger/tinyutils/KeyedVector.h index 1be2094e9..9d8668b9c 100644 --- a/libpixelflinger/tinyutils/KeyedVector.h +++ b/libpixelflinger/codeflinger/tinyutils/KeyedVector.h | |||
@@ -1,25 +1,34 @@ | |||
1 | /* | 1 | /* |
2 | * keyed_vector.h | 2 | * Copyright 2005 The Android Open Source Project |
3 | * Android | ||
4 | * | 3 | * |
5 | * Created on 11/18/05. | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
6 | * Copyright 2005 The Android Open Source Project | 5 | * you may not use this file except in compliance with the License. |
6 | * You may obtain a copy of the License at | ||
7 | * | 7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
8 | */ | 15 | */ |
9 | 16 | ||
10 | #ifndef ANDROID_KEYED_VECTOR_H | 17 | #ifndef ANDROID_PIXELFLINGER_KEYED_VECTOR_H |
11 | #define ANDROID_KEYED_VECTOR_H | 18 | #define ANDROID_PIXELFLINGER_KEYED_VECTOR_H |
12 | 19 | ||
13 | #include <assert.h> | 20 | #include <assert.h> |
14 | #include <stdint.h> | 21 | #include <stdint.h> |
15 | #include <sys/types.h> | 22 | #include <sys/types.h> |
16 | 23 | ||
17 | #include "tinyutils/SortedVector.h" | 24 | #include "Errors.h" |
18 | #include "tinyutils/TypeHelpers.h" | 25 | #include "SortedVector.h" |
26 | #include "TypeHelpers.h" | ||
19 | 27 | ||
20 | // --------------------------------------------------------------------------- | 28 | // --------------------------------------------------------------------------- |
21 | 29 | ||
22 | namespace android { | 30 | namespace android { |
31 | namespace tinyutils { | ||
23 | 32 | ||
24 | template <typename KEY, typename VALUE> | 33 | template <typename KEY, typename VALUE> |
25 | class KeyedVector | 34 | class KeyedVector |
@@ -186,8 +195,9 @@ const VALUE& DefaultKeyedVector<KEY,VALUE>::valueFor(const KEY& key) const { | |||
186 | return i >= 0 ? KeyedVector<KEY,VALUE>::valueAt(i) : mDefault; | 195 | return i >= 0 ? KeyedVector<KEY,VALUE>::valueAt(i) : mDefault; |
187 | } | 196 | } |
188 | 197 | ||
189 | }; // namespace android | 198 | } // namespace tinyutils |
199 | } // namespace android | ||
190 | 200 | ||
191 | // --------------------------------------------------------------------------- | 201 | // --------------------------------------------------------------------------- |
192 | 202 | ||
193 | #endif // ANDROID_KEYED_VECTOR_H | 203 | #endif // ANDROID_PIXELFLINGER_KEYED_VECTOR_H |
diff --git a/libpixelflinger/tinyutils/SharedBuffer.cpp b/libpixelflinger/codeflinger/tinyutils/SharedBuffer.cpp index ef781a75c..ef453fa6c 100644 --- a/libpixelflinger/tinyutils/SharedBuffer.cpp +++ b/libpixelflinger/codeflinger/tinyutils/SharedBuffer.cpp | |||
@@ -1,9 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * SharedBuffer.cpp | 2 | * Copyright 2005 The Android Open Source Project |
3 | * Android | ||
4 | * | 3 | * |
5 | * Copyright 2005 The Android Open Source Project | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
6 | * | 7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
7 | */ | 15 | */ |
8 | 16 | ||
9 | #include <stdlib.h> | 17 | #include <stdlib.h> |
@@ -11,11 +19,12 @@ | |||
11 | 19 | ||
12 | #include <cutils/atomic.h> | 20 | #include <cutils/atomic.h> |
13 | 21 | ||
14 | #include "tinyutils/SharedBuffer.h" | 22 | #include "SharedBuffer.h" |
15 | 23 | ||
16 | // --------------------------------------------------------------------------- | 24 | // --------------------------------------------------------------------------- |
17 | 25 | ||
18 | namespace android { | 26 | namespace android { |
27 | namespace tinyutils { | ||
19 | 28 | ||
20 | SharedBuffer* SharedBuffer::alloc(size_t size) | 29 | SharedBuffer* SharedBuffer::alloc(size_t size) |
21 | { | 30 | { |
@@ -102,5 +111,5 @@ int32_t SharedBuffer::release(uint32_t flags) const | |||
102 | return prev; | 111 | return prev; |
103 | } | 112 | } |
104 | 113 | ||
105 | 114 | } // namespace tinyutils | |
106 | }; // namespace android | 115 | } // namespace android |
diff --git a/libpixelflinger/tinyutils/SharedBuffer.h b/libpixelflinger/codeflinger/tinyutils/SharedBuffer.h index 9f631213a..d69b4179b 100644 --- a/libpixelflinger/tinyutils/SharedBuffer.h +++ b/libpixelflinger/codeflinger/tinyutils/SharedBuffer.h | |||
@@ -1,13 +1,21 @@ | |||
1 | /* | 1 | /* |
2 | * SharedBuffer.h | 2 | * Copyright 2005 The Android Open Source Project |
3 | * Android | ||
4 | * | 3 | * |
5 | * Copyright 2005 The Android Open Source Project | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
6 | * | 7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
7 | */ | 15 | */ |
8 | 16 | ||
9 | #ifndef ANDROID_SHARED_BUFFER_H | 17 | #ifndef ANDROID_PIXELFLINGER_SHARED_BUFFER_H |
10 | #define ANDROID_SHARED_BUFFER_H | 18 | #define ANDROID_PIXELFLINGER_SHARED_BUFFER_H |
11 | 19 | ||
12 | #include <stdint.h> | 20 | #include <stdint.h> |
13 | #include <sys/types.h> | 21 | #include <sys/types.h> |
@@ -15,6 +23,7 @@ | |||
15 | // --------------------------------------------------------------------------- | 23 | // --------------------------------------------------------------------------- |
16 | 24 | ||
17 | namespace android { | 25 | namespace android { |
26 | namespace tinyutils { | ||
18 | 27 | ||
19 | class SharedBuffer | 28 | class SharedBuffer |
20 | { | 29 | { |
@@ -131,8 +140,9 @@ bool SharedBuffer::onlyOwner() const { | |||
131 | return (mRefs == 1); | 140 | return (mRefs == 1); |
132 | } | 141 | } |
133 | 142 | ||
134 | }; // namespace android | 143 | } // namespace tinyutils |
144 | } // namespace android | ||
135 | 145 | ||
136 | // --------------------------------------------------------------------------- | 146 | // --------------------------------------------------------------------------- |
137 | 147 | ||
138 | #endif // ANDROID_VECTOR_H | 148 | #endif // ANDROID_PIXELFLINGER_SHARED_BUFFER_H |
diff --git a/libpixelflinger/tinyutils/SortedVector.h b/libpixelflinger/codeflinger/tinyutils/SortedVector.h index 7a6b4435f..a2b700542 100644 --- a/libpixelflinger/tinyutils/SortedVector.h +++ b/libpixelflinger/codeflinger/tinyutils/SortedVector.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2005 The Android Open Source Project | 2 | * Copyright 2005 The Android Open Source Project |
3 | * | 3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. | 5 | * you may not use this file except in compliance with the License. |
@@ -14,20 +14,21 @@ | |||
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #ifndef ANDROID_SORTED_VECTOR_H | 17 | #ifndef ANDROID_PIXELFLINGER_SORTED_VECTOR_H |
18 | #define ANDROID_SORTED_VECTOR_H | 18 | #define ANDROID_PIXELFLINGER_SORTED_VECTOR_H |
19 | 19 | ||
20 | #include <assert.h> | 20 | #include <assert.h> |
21 | #include <stdint.h> | 21 | #include <stdint.h> |
22 | #include <sys/types.h> | 22 | #include <sys/types.h> |
23 | 23 | ||
24 | #include "tinyutils/Vector.h" | 24 | #include "Vector.h" |
25 | #include "tinyutils/VectorImpl.h" | 25 | #include "VectorImpl.h" |
26 | #include "tinyutils/TypeHelpers.h" | 26 | #include "TypeHelpers.h" |
27 | 27 | ||
28 | // --------------------------------------------------------------------------- | 28 | // --------------------------------------------------------------------------- |
29 | 29 | ||
30 | namespace android { | 30 | namespace android { |
31 | namespace tinyutils { | ||
31 | 32 | ||
32 | template <class TYPE> | 33 | template <class TYPE> |
33 | class SortedVector : private SortedVectorImpl | 34 | class SortedVector : private SortedVectorImpl |
@@ -274,9 +275,10 @@ int SortedVector<TYPE>::do_compare(const void* lhs, const void* rhs) const { | |||
274 | return compare_type( *reinterpret_cast<const TYPE*>(lhs), *reinterpret_cast<const TYPE*>(rhs) ); | 275 | return compare_type( *reinterpret_cast<const TYPE*>(lhs), *reinterpret_cast<const TYPE*>(rhs) ); |
275 | } | 276 | } |
276 | 277 | ||
277 | }; // namespace android | 278 | } // namespace tinyutils |
279 | } // namespace android | ||
278 | 280 | ||
279 | 281 | ||
280 | // --------------------------------------------------------------------------- | 282 | // --------------------------------------------------------------------------- |
281 | 283 | ||
282 | #endif // ANDROID_SORTED_VECTOR_H | 284 | #endif // ANDROID_PIXELFLINGER_SORTED_VECTOR_H |
diff --git a/libpixelflinger/tinyutils/TypeHelpers.h b/libpixelflinger/codeflinger/tinyutils/TypeHelpers.h index 9500c9044..7abff072f 100644 --- a/libpixelflinger/tinyutils/TypeHelpers.h +++ b/libpixelflinger/codeflinger/tinyutils/TypeHelpers.h | |||
@@ -1,12 +1,21 @@ | |||
1 | /* | 1 | /* |
2 | * TypeHelpers.h | 2 | * Copyright 2005 The Android Open Source Project |
3 | * | ||
4 | * Copyright 2005 The Android Open Source Project | ||
5 | * | 3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
7 | * | ||
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
6 | */ | 15 | */ |
7 | 16 | ||
8 | #ifndef ANDROID_TYPE_HELPERS_H | 17 | #ifndef ANDROID_PIXELFLINGER_TYPE_HELPERS_H |
9 | #define ANDROID_TYPE_HELPERS_H | 18 | #define ANDROID_PIXELFLINGER_TYPE_HELPERS_H |
10 | 19 | ||
11 | #include <new> | 20 | #include <new> |
12 | #include <stdint.h> | 21 | #include <stdint.h> |
@@ -16,6 +25,7 @@ | |||
16 | // --------------------------------------------------------------------------- | 25 | // --------------------------------------------------------------------------- |
17 | 26 | ||
18 | namespace android { | 27 | namespace android { |
28 | namespace tinyutils { | ||
19 | 29 | ||
20 | /* | 30 | /* |
21 | * Types traits | 31 | * Types traits |
@@ -238,8 +248,9 @@ struct trait_trivial_assign< key_value_pair_t<K, V> > | |||
238 | 248 | ||
239 | // --------------------------------------------------------------------------- | 249 | // --------------------------------------------------------------------------- |
240 | 250 | ||
241 | }; // namespace android | 251 | } // namespace tinyutils |
252 | } // namespace android | ||
242 | 253 | ||
243 | // --------------------------------------------------------------------------- | 254 | // --------------------------------------------------------------------------- |
244 | 255 | ||
245 | #endif // ANDROID_TYPE_HELPERS_H | 256 | #endif // ANDROID_PIXELFLINGER_TYPE_HELPERS_H |
diff --git a/libpixelflinger/tinyutils/Vector.h b/libpixelflinger/codeflinger/tinyutils/Vector.h index 14cf99a43..c07a17aa5 100644 --- a/libpixelflinger/tinyutils/Vector.h +++ b/libpixelflinger/codeflinger/tinyutils/Vector.h | |||
@@ -1,13 +1,21 @@ | |||
1 | /* | 1 | /* |
2 | * vector.h | 2 | * Copyright 2005 The Android Open Source Project |
3 | * Android | ||
4 | * | 3 | * |
5 | * Copyright 2005 The Android Open Source Project | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
6 | * | 7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
7 | */ | 15 | */ |
8 | 16 | ||
9 | #ifndef ANDROID_VECTOR_H | 17 | #ifndef ANDROID_PIXELFLINGER_VECTOR_H |
10 | #define ANDROID_VECTOR_H | 18 | #define ANDROID_PIXELFLINGER_VECTOR_H |
11 | 19 | ||
12 | #include <new> | 20 | #include <new> |
13 | #include <stdint.h> | 21 | #include <stdint.h> |
@@ -15,13 +23,14 @@ | |||
15 | 23 | ||
16 | #include <cutils/log.h> | 24 | #include <cutils/log.h> |
17 | 25 | ||
18 | #include "tinyutils/Errors.h" | 26 | #include "Errors.h" |
19 | #include "tinyutils/VectorImpl.h" | 27 | #include "VectorImpl.h" |
20 | #include "tinyutils/TypeHelpers.h" | 28 | #include "TypeHelpers.h" |
21 | 29 | ||
22 | // --------------------------------------------------------------------------- | 30 | // --------------------------------------------------------------------------- |
23 | 31 | ||
24 | namespace android { | 32 | namespace android { |
33 | namespace tinyutils { | ||
25 | 34 | ||
26 | /*! | 35 | /*! |
27 | * The main templated vector class ensuring type safety | 36 | * The main templated vector class ensuring type safety |
@@ -335,9 +344,10 @@ void Vector<TYPE>::do_move_backward(void* dest, const void* from, size_t num) co | |||
335 | move_backward_type( reinterpret_cast<TYPE*>(dest), reinterpret_cast<const TYPE*>(from), num ); | 344 | move_backward_type( reinterpret_cast<TYPE*>(dest), reinterpret_cast<const TYPE*>(from), num ); |
336 | } | 345 | } |
337 | 346 | ||
338 | }; // namespace android | 347 | } // namespace tinyutils |
348 | } // namespace android | ||
339 | 349 | ||
340 | 350 | ||
341 | // --------------------------------------------------------------------------- | 351 | // --------------------------------------------------------------------------- |
342 | 352 | ||
343 | #endif // ANDROID_VECTOR_H | 353 | #endif // ANDROID_PIXELFLINGER_VECTOR_H |
diff --git a/libpixelflinger/tinyutils/VectorImpl.cpp b/libpixelflinger/codeflinger/tinyutils/VectorImpl.cpp index 05c4945b6..689129a65 100644 --- a/libpixelflinger/tinyutils/VectorImpl.cpp +++ b/libpixelflinger/codeflinger/tinyutils/VectorImpl.cpp | |||
@@ -1,9 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * vector_impl.cpp | 2 | * Copyright 2005 The Android Open Source Project |
3 | * Android | ||
4 | * | 3 | * |
5 | * Copyright 2005 The Android Open Source Project | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
6 | * | 7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
7 | */ | 15 | */ |
8 | 16 | ||
9 | #define LOG_TAG "Vector" | 17 | #define LOG_TAG "Vector" |
@@ -15,21 +23,15 @@ | |||
15 | 23 | ||
16 | #include <cutils/log.h> | 24 | #include <cutils/log.h> |
17 | 25 | ||
18 | #include "tinyutils/SharedBuffer.h" | 26 | #include "Errors.h" |
19 | #include "tinyutils/VectorImpl.h" | 27 | #include "SharedBuffer.h" |
28 | #include "VectorImpl.h" | ||
20 | 29 | ||
21 | /*****************************************************************************/ | 30 | /*****************************************************************************/ |
22 | 31 | ||
23 | 32 | ||
24 | namespace android { | 33 | namespace android { |
25 | 34 | namespace tinyutils { | |
26 | enum { | ||
27 | NO_ERROR = 0, // No errors. | ||
28 | NO_MEMORY = -ENOMEM, | ||
29 | BAD_VALUE = -EINVAL, | ||
30 | BAD_INDEX = -EOVERFLOW, | ||
31 | NAME_NOT_FOUND = -ENOENT, | ||
32 | }; | ||
33 | 35 | ||
34 | // ---------------------------------------------------------------------------- | 36 | // ---------------------------------------------------------------------------- |
35 | 37 | ||
@@ -548,5 +550,6 @@ void SortedVectorImpl::reservedSortedVectorImpl8() { }; | |||
548 | 550 | ||
549 | /*****************************************************************************/ | 551 | /*****************************************************************************/ |
550 | 552 | ||
551 | }; // namespace android | 553 | } // namespace tinyutils |
554 | } // namespace android | ||
552 | 555 | ||
diff --git a/libpixelflinger/tinyutils/VectorImpl.h b/libpixelflinger/codeflinger/tinyutils/VectorImpl.h index e868ecaf9..56089b325 100644 --- a/libpixelflinger/tinyutils/VectorImpl.h +++ b/libpixelflinger/codeflinger/tinyutils/VectorImpl.h | |||
@@ -1,13 +1,21 @@ | |||
1 | /* | 1 | /* |
2 | * vector_impl.h | 2 | * Copyright 2005 The Android Open Source Project |
3 | * Android | ||
4 | * | 3 | * |
5 | * Copyright 2005 The Android Open Source Project | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
6 | * | 7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
7 | */ | 15 | */ |
8 | 16 | ||
9 | #ifndef ANDROID_VECTOR_IMPL_H | 17 | #ifndef ANDROID_PIXELFLINGER_VECTOR_IMPL_H |
10 | #define ANDROID_VECTOR_IMPL_H | 18 | #define ANDROID_PIXELFLINGER_VECTOR_IMPL_H |
11 | 19 | ||
12 | #include <assert.h> | 20 | #include <assert.h> |
13 | #include <stdint.h> | 21 | #include <stdint.h> |
@@ -18,6 +26,7 @@ | |||
18 | // --------------------------------------------------------------------------- | 26 | // --------------------------------------------------------------------------- |
19 | 27 | ||
20 | namespace android { | 28 | namespace android { |
29 | namespace tinyutils { | ||
21 | 30 | ||
22 | /*! | 31 | /*! |
23 | * Implementation of the guts of the vector<> class | 32 | * Implementation of the guts of the vector<> class |
@@ -177,9 +186,10 @@ private: | |||
177 | ssize_t replaceAt(const void* item, size_t index); | 186 | ssize_t replaceAt(const void* item, size_t index); |
178 | }; | 187 | }; |
179 | 188 | ||
180 | }; // namespace android | 189 | } // namespace tinyutils |
190 | } // namespace android | ||
181 | 191 | ||
182 | 192 | ||
183 | // --------------------------------------------------------------------------- | 193 | // --------------------------------------------------------------------------- |
184 | 194 | ||
185 | #endif // ANDROID_VECTOR_IMPL_H | 195 | #endif // ANDROID_PIXELFLINGER_VECTOR_IMPL_H |
diff --git a/libpixelflinger/tinyutils/smartpointer.h b/libpixelflinger/codeflinger/tinyutils/smartpointer.h index 88032d7fb..9d0a16e5c 100644 --- a/libpixelflinger/tinyutils/smartpointer.h +++ b/libpixelflinger/codeflinger/tinyutils/smartpointer.h | |||
@@ -1,13 +1,21 @@ | |||
1 | /* | 1 | /* |
2 | * smartpointer.h | 2 | * Copyright 2005 The Android Open Source Project |
3 | * Android | ||
4 | * | 3 | * |
5 | * Copyright 2005 The Android Open Source Project | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. | ||
6 | * You may obtain a copy of the License at | ||
6 | * | 7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | * | ||
10 | * Unless required by applicable law or agreed to in writing, software | ||
11 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | * See the License for the specific language governing permissions and | ||
14 | * limitations under the License. | ||
7 | */ | 15 | */ |
8 | 16 | ||
9 | #ifndef ANDROID_SMART_POINTER_H | 17 | #ifndef ANDROID_PIXELFLINGER_SMART_POINTER_H |
10 | #define ANDROID_SMART_POINTER_H | 18 | #define ANDROID_PIXELFLINGER_SMART_POINTER_H |
11 | 19 | ||
12 | #include <stdint.h> | 20 | #include <stdint.h> |
13 | #include <sys/types.h> | 21 | #include <sys/types.h> |
@@ -15,6 +23,7 @@ | |||
15 | 23 | ||
16 | // --------------------------------------------------------------------------- | 24 | // --------------------------------------------------------------------------- |
17 | namespace android { | 25 | namespace android { |
26 | namespace tinyutils { | ||
18 | 27 | ||
19 | // --------------------------------------------------------------------------- | 28 | // --------------------------------------------------------------------------- |
20 | 29 | ||
@@ -163,8 +172,9 @@ void sp<T>::clear() | |||
163 | 172 | ||
164 | // --------------------------------------------------------------------------- | 173 | // --------------------------------------------------------------------------- |
165 | 174 | ||
166 | }; // namespace android | 175 | } // namespace tinyutils |
176 | } // namespace android | ||
167 | 177 | ||
168 | // --------------------------------------------------------------------------- | 178 | // --------------------------------------------------------------------------- |
169 | 179 | ||
170 | #endif // ANDROID_SMART_POINTER_H | 180 | #endif // ANDROID_PIXELFLINGER_SMART_POINTER_H |