Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 1634) sorted by relevance

12345678910>>...66

/frameworks/compile/mclinker/unittests/
DLEB128Test.cpp42 leb128::ByteType buffer[2]; in TEST_F() local
46 result = buffer; in TEST_F()
48 ASSERT_EQ(buffer[0], 2); in TEST_F()
49 ASSERT_EQ(result, buffer + 1); in TEST_F()
52 result = buffer; in TEST_F()
54 ASSERT_EQ(buffer[0], 127); in TEST_F()
55 ASSERT_EQ(result, buffer + 1); in TEST_F()
58 result = buffer; in TEST_F()
60 ASSERT_EQ(buffer[0], 0 + 0x80); in TEST_F()
61 ASSERT_EQ(buffer[1], 1); in TEST_F()
[all …]
/frameworks/native/libs/input/tests/
DRingBuffer_test.cpp36 RingBuffer<int> buffer(/*capacity=*/3); in TEST() local
38 buffer.pushBack(1); in TEST()
39 buffer.pushBack(2); in TEST()
40 buffer.pushBack(3); in TEST()
41 EXPECT_THAT(buffer, ElementsAre(1, 2, 3)); in TEST()
43 buffer.pushBack(4); in TEST()
44 EXPECT_THAT(buffer, ElementsAre(2, 3, 4)); in TEST()
46 buffer.pushFront(1); in TEST()
47 EXPECT_THAT(buffer, ElementsAre(1, 2, 3)); in TEST()
49 EXPECT_EQ(1, buffer.popFront()); in TEST()
[all …]
/frameworks/base/media/jni/
Dandroid_media_Utils.cpp113 uint32_t Image_getBlobSize(LockedImage* buffer, bool usingRGBAOverride) { in Image_getBlobSize() argument
115 LOG_ALWAYS_FATAL_IF(buffer == NULL, "Input buffer is NULL!!!"); in Image_getBlobSize()
117 uint32_t width = buffer->width; in Image_getBlobSize()
118 uint8_t* blobBuffer = buffer->data; in Image_getBlobSize()
121 width = (buffer->width + buffer->stride * (buffer->height - 1)) * 4; in Image_getBlobSize()
154 status_t getLockedImageInfo(LockedImage* buffer, int idx, in getLockedImageInfo() argument
157 LOG_ALWAYS_FATAL_IF(buffer == NULL, "Input buffer is NULL!!!"); in getLockedImageInfo()
164 ALOGV("%s: buffer: %p", __FUNCTION__, buffer); in getLockedImageInfo()
173 int32_t fmt = buffer->flexFormat; in getLockedImageInfo()
180 if (buffer->width % 2 != 0) { in getLockedImageInfo()
[all …]
/frameworks/base/core/java/android/text/method/
DArrowKeyMovementMethod.java34 private static boolean isSelecting(Spannable buffer) { in isSelecting() argument
35 return ((MetaKeyKeyListener.getMetaState(buffer, MetaKeyKeyListener.META_SHIFT_ON) == 1) || in isSelecting()
36 (MetaKeyKeyListener.getMetaState(buffer, MetaKeyKeyListener.META_SELECTING) != 0)); in isSelecting()
39 private static int getCurrentLineTop(Spannable buffer, Layout layout) { in getCurrentLineTop() argument
40 return layout.getLineTop(layout.getLineForOffset(Selection.getSelectionEnd(buffer))); in getCurrentLineTop()
52 protected boolean handleMovementKey(TextView widget, Spannable buffer, int keyCode, in handleMovementKey() argument
59 && MetaKeyKeyListener.getMetaState(buffer, in handleMovementKey()
66 return super.handleMovementKey(widget, buffer, keyCode, movementMetaState, event); in handleMovementKey()
70 protected boolean left(TextView widget, Spannable buffer) { in left() argument
75 if (isSelecting(buffer)) { in left()
[all …]
DScrollingMovementMethod.java30 protected boolean left(TextView widget, Spannable buffer) { in left() argument
31 return scrollLeft(widget, buffer, 1); in left()
35 protected boolean right(TextView widget, Spannable buffer) { in right() argument
36 return scrollRight(widget, buffer, 1); in right()
40 protected boolean up(TextView widget, Spannable buffer) { in up() argument
41 return scrollUp(widget, buffer, 1); in up()
45 protected boolean down(TextView widget, Spannable buffer) { in down() argument
46 return scrollDown(widget, buffer, 1); in down()
50 protected boolean pageUp(TextView widget, Spannable buffer) { in pageUp() argument
51 return scrollPageUp(widget, buffer); in pageUp()
[all …]
/frameworks/base/libs/protoutil/tests/
DEncodedBuffer_test.cpp32 sp<EncodedBuffer> buffer = new EncodedBuffer(TEST_CHUNK_SIZE); in TEST() local
33 EXPECT_EQ(buffer->size(), 0UL); in TEST()
34 expectPointer(buffer->wp(), 0); in TEST()
35 EXPECT_EQ(buffer->currentToWrite(), TEST_CHUNK_SIZE); in TEST()
37 buffer->writeRawByte(50 + i); in TEST()
39 EXPECT_EQ(buffer->size(), TEST_CHUNK_HALF_SIZE); in TEST()
40 expectPointer(buffer->wp(), TEST_CHUNK_HALF_SIZE); in TEST()
41 EXPECT_EQ(buffer->currentToWrite(), TEST_CHUNK_HALF_SIZE); in TEST()
43 buffer->writeRawByte(80 + i); in TEST()
45 EXPECT_EQ(buffer->size(), TEST_CHUNK_SIZE + TEST_CHUNK_HALF_SIZE); in TEST()
[all …]
/frameworks/libs/net/common/tests/unit/src/com/android/net/module/util/async/
DCircularByteBufferTest.java37 CircularByteBuffer buffer = new CircularByteBuffer(capacity); in writeBytes() local
38 assertEquals(0, buffer.size()); in writeBytes()
39 assertEquals(0, buffer.getDirectReadSize()); in writeBytes()
40 assertEquals(capacity, buffer.freeSize()); in writeBytes()
41 assertEquals(capacity, buffer.getDirectWriteSize()); in writeBytes()
44 buffer.writeBytes(writeBuffer, 0, writeBuffer.length); in writeBytes()
46 assertEquals(writeBuffer.length, buffer.size()); in writeBytes()
47 assertEquals(writeBuffer.length, buffer.getDirectReadSize()); in writeBytes()
48 assertEquals(capacity - writeBuffer.length, buffer.freeSize()); in writeBytes()
49 assertEquals(capacity - writeBuffer.length, buffer.getDirectWriteSize()); in writeBytes()
[all …]
/frameworks/native/libs/gui/
DIGraphicBufferProducerFlattenables.cpp46 void*& buffer, size_t& size, int*& fds, size_t& count) const in flatten() argument
52 FlattenableUtils::write(buffer, size, timestamp); in flatten()
53 FlattenableUtils::write(buffer, size, isAutoTimestamp); in flatten()
54 FlattenableUtils::write(buffer, size, dataSpace); in flatten()
55 FlattenableUtils::write(buffer, size, crop); in flatten()
56 FlattenableUtils::write(buffer, size, scalingMode); in flatten()
57 FlattenableUtils::write(buffer, size, transform); in flatten()
58 FlattenableUtils::write(buffer, size, stickyTransform); in flatten()
59 FlattenableUtils::write(buffer, size, getFrameTimestamps); in flatten()
61 status_t result = fence->flatten(buffer, size, fds, count); in flatten()
[all …]
DBufferItem.cpp120 static void writeAligned(void*& buffer, size_t& size, T value) { in writeAligned() argument
121 size -= FlattenableUtils::align<alignof(T)>(buffer); in writeAligned()
122 FlattenableUtils::write(buffer, size, value); in writeAligned()
126 void*& buffer, size_t& size, int*& fds, size_t& count) const { in flatten() argument
134 uint32_t& flags = *static_cast<uint32_t*>(buffer); in flatten()
137 FlattenableUtils::advance(buffer, size, sizeof(uint32_t)); in flatten()
141 status_t err = mGraphicBuffer->flatten(buffer, size, fds, count); in flatten()
143 size -= FlattenableUtils::align<4>(buffer); in flatten()
147 status_t err = mFence->flatten(buffer, size, fds, count); in flatten()
149 size -= FlattenableUtils::align<4>(buffer); in flatten()
[all …]
/frameworks/base/libs/androidfw/tests/
DBigBuffer_test.cpp27 BigBuffer buffer(4); in TEST() local
29 EXPECT_THAT(buffer.NextBlock<char>(2), NotNull()); in TEST()
30 EXPECT_EQ(2u, buffer.size()); in TEST()
34 BigBuffer buffer(16); in TEST() local
36 char* b1 = buffer.NextBlock<char>(8); in TEST()
39 char* b2 = buffer.NextBlock<char>(4); in TEST()
46 BigBuffer buffer(16); in TEST() local
48 EXPECT_THAT(buffer.NextBlock<char>(32), NotNull()); in TEST()
49 EXPECT_EQ(32u, buffer.size()); in TEST()
53 BigBuffer buffer(16); in TEST() local
[all …]
/frameworks/base/core/tests/coretests/src/com/android/internal/util/
DRingBufferTest.java35 RingBuffer<String> buffer = new RingBuffer<>(String.class, 100); in testEmptyRingBuffer() local
37 assertArrayEquals(new String[0], buffer.toArray()); in testEmptyRingBuffer()
43 RingBuffer<String> buffer = new RingBuffer<>(String.class, -10); in testIncorrectConstructorArguments() local
49 RingBuffer<String> buffer = new RingBuffer<>(String.class, 0); in testIncorrectConstructorArguments() local
57 RingBuffer<String> buffer = new RingBuffer<>(String.class, 100); in testRingBufferWithNoWrapping() local
59 buffer.append("a"); in testRingBufferWithNoWrapping()
60 buffer.append("b"); in testRingBufferWithNoWrapping()
61 buffer.append("c"); in testRingBufferWithNoWrapping()
62 buffer.append("d"); in testRingBufferWithNoWrapping()
63 buffer.append("e"); in testRingBufferWithNoWrapping()
[all …]
/frameworks/base/services/core/java/com/android/server/locksettings/
DVersionedPasswordMetrics.java53 final ByteBuffer buffer = ByteBuffer.allocate(Integer.BYTES * 11); in serialize() local
54 buffer.putInt(mVersion); in serialize()
55 buffer.putInt(mMetrics.credType); in serialize()
56 buffer.putInt(mMetrics.length); in serialize()
57 buffer.putInt(mMetrics.letters); in serialize()
58 buffer.putInt(mMetrics.upperCase); in serialize()
59 buffer.putInt(mMetrics.lowerCase); in serialize()
60 buffer.putInt(mMetrics.numeric); in serialize()
61 buffer.putInt(mMetrics.symbols); in serialize()
62 buffer.putInt(mMetrics.nonLetter); in serialize()
[all …]
/frameworks/av/media/module/extractors/mp3/
DXINGSeeker.cpp86 uint8_t buffer[4]; in CreateFromSource() local
88 if (source->readAt(offset, &buffer, 4) < 4) { // get header in CreateFromSource()
93 int header = U32_AT(buffer);; in CreateFromSource()
102 uint8_t version = (buffer[1] >> 3) & 3; in CreateFromSource()
115 if (source->readAt(offset, &buffer, 4) < 4) { // XING header ID in CreateFromSource()
120 if ((buffer[0] != 'X') || (buffer[1] != 'i') in CreateFromSource()
121 || (buffer[2] != 'n') || (buffer[3] != 'g')) { in CreateFromSource()
122 if ((buffer[0] != 'I') || (buffer[1] != 'n') in CreateFromSource()
123 || (buffer[2] != 'f') || (buffer[3] != 'o')) { in CreateFromSource()
128 if (source->readAt(offset, &buffer, 4) < 4) { // flags in CreateFromSource()
[all …]
/frameworks/base/libs/hwui/tests/unit/
DCanvasOpTests.cpp74 CanvasOpBuffer buffer; in TEST() local
75 buffer.push<Op::DrawColor>({ in TEST()
79 buffer.for_each([](auto op) { in TEST()
88 CanvasOpBuffer buffer; in TEST() local
89 EXPECT_EQ(buffer.size(), 0); in TEST()
90 buffer.push<Op::Save>({}); in TEST()
91 buffer.push<Op::Save>({}); in TEST()
92 buffer.push<Op::Restore>({}); in TEST()
93 EXPECT_GT(buffer.size(), 0); in TEST()
99 buffer.for_each([&](auto op) { in TEST()
[all …]
DOpBufferTests.cpp99 MockBuffer buffer; in TEST() local
100 buffer.push_container(MockOpContainer<Op::Lifecycle> { in TEST()
104 buffer.clear(); in TEST()
113 MockBuffer buffer; in TEST() local
114 buffer.push_container(MockOpContainer<Op::Lifecycle> { in TEST()
119 MockBuffer other(std::move(buffer)); in TEST()
121 EXPECT_EQ(buffer.size(), 0); in TEST()
124 EXPECT_EQ(0, countItems(buffer)); in TEST()
133 buffer.push_container(MockOpContainer<MockTypes::Lifecycle> { in TEST()
136 EXPECT_EQ(1, countItems(buffer)); in TEST()
[all …]
/frameworks/native/libs/vr/libpdx/
Dserialization_tests.cpp1287 Payload buffer; in TEST() local
1292 buffer = {ENCODING_TYPE_TRUE}; in TEST()
1293 error = Deserialize(&result, &buffer); in TEST()
1298 buffer = {ENCODING_TYPE_FALSE}; in TEST()
1299 error = Deserialize(&result, &buffer); in TEST()
1305 Payload buffer; in TEST() local
1310 buffer = {ENCODING_TYPE_POSITIVE_FIXINT_MIN}; in TEST()
1311 error = Deserialize(&result, &buffer); in TEST()
1316 buffer = {ENCODING_TYPE_POSITIVE_FIXINT_MAX}; in TEST()
1317 error = Deserialize(&result, &buffer); in TEST()
[all …]
/frameworks/av/media/libnbaio/
DSourceAudioBufferProvider.cpp48 status_t SourceAudioBufferProvider::getNextBuffer(Buffer *buffer) in getNextBuffer() argument
50 ALOG_ASSERT(buffer != NULL && buffer->frameCount > 0 && mGetCount == 0); in getNextBuffer()
54 if (mRemaining < buffer->frameCount) { in getNextBuffer()
55 buffer->frameCount = mRemaining; in getNextBuffer()
57 buffer->raw = (char *) mAllocated + (mOffset * mFrameSize); in getNextBuffer()
58 mGetCount = buffer->frameCount; in getNextBuffer()
62 if (buffer->frameCount > mSize) { in getNextBuffer()
67 mAllocated = calloc(buffer->frameCount, mFrameSize); in getNextBuffer()
72 mSize = buffer->frameCount; in getNextBuffer()
76 ssize_t actual = mSource->read(mAllocated, buffer->frameCount); in getNextBuffer()
[all …]
/frameworks/base/core/java/android/os/incremental/
DV4Signature.java68 ByteBuffer buffer = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); in fromByteArray() local
69 final int hashAlgorithm = buffer.getInt(); in fromByteArray()
70 final byte log2BlockSize = buffer.get(); in fromByteArray()
71 byte[] salt = readBytes(buffer); in fromByteArray()
72 byte[] rawRootHash = readBytes(buffer); in fromByteArray()
108 public static SigningInfo fromByteBuffer(ByteBuffer buffer) throws IOException { in fromByteBuffer() argument
109 byte[] apkDigest = readBytes(buffer); in fromByteBuffer()
110 byte[] certificate = readBytes(buffer); in fromByteBuffer()
111 byte[] additionalData = readBytes(buffer); in fromByteBuffer()
112 byte[] publicKey = readBytes(buffer); in fromByteBuffer()
[all …]
/frameworks/base/core/java/android/hardware/camera2/marshal/impl/
DMarshalQueryablePrimitive.java64 public T unmarshal(ByteBuffer buffer) { in unmarshal() argument
65 return mClass.cast(unmarshalObject(buffer)); in unmarshal()
74 public void marshal(T value, ByteBuffer buffer) { in marshal() argument
78 marshalPrimitive(val, buffer); in marshal()
82 marshalPrimitive(val, buffer); in marshal()
86 marshalPrimitive(val, buffer); in marshal()
89 marshalPrimitive((Rational) value, buffer); in marshal() local
93 marshalPrimitive(val, buffer); in marshal()
97 marshalPrimitive(val, buffer); in marshal()
104 private void marshalPrimitive(int value, ByteBuffer buffer) { in marshalPrimitive() argument
[all …]
/frameworks/base/graphics/java/android/graphics/fonts/
DFontFileUtil.java71 public static final int analyzeStyle(@NonNull ByteBuffer buffer, in analyzeStyle() argument
92 ByteOrder originalOrder = buffer.order(); in analyzeStyle()
93 buffer.order(ByteOrder.BIG_ENDIAN); in analyzeStyle()
96 int magicNumber = buffer.getInt(0); in analyzeStyle()
99 if (ttcIndex >= buffer.getInt(8 /* offset to number of fonts in TTC */)) { in analyzeStyle()
102 fontFileOffset = buffer.getInt( in analyzeStyle()
105 int sfntVersion = buffer.getInt(fontFileOffset); in analyzeStyle()
111 int numTables = buffer.getShort(fontFileOffset + 4 /* offset to number of tables */); in analyzeStyle()
116 if (buffer.getInt(tableOffset) == OS2_TABLE_TAG) { in analyzeStyle()
117 os2TableOffset = buffer.getInt(tableOffset + 8 /* offset to the table */); in analyzeStyle()
[all …]
/frameworks/base/tools/aapt2/io/
DFileStream_test.cpp43 const void* buffer; in TEST() local
45 ASSERT_TRUE(in.Next(&buffer, &size)) << in.GetError(); in TEST()
47 ASSERT_THAT(buffer, NotNull()); in TEST()
49 EXPECT_THAT(StringPiece(reinterpret_cast<const char*>(buffer), size), Eq("this is a ")); in TEST()
51 ASSERT_TRUE(in.Next(&buffer, &size)); in TEST()
53 ASSERT_THAT(buffer, NotNull()); in TEST()
55 EXPECT_THAT(StringPiece(reinterpret_cast<const char*>(buffer), size), Eq("cool strin")); in TEST()
60 ASSERT_TRUE(in.Next(&buffer, &size)); in TEST()
62 ASSERT_THAT(buffer, NotNull()); in TEST()
64 EXPECT_THAT(StringPiece(reinterpret_cast<const char*>(buffer), size), Eq("strin")); in TEST()
[all …]
/frameworks/av/media/module/foundation/
DMediaBufferGroup.cpp82 MediaBuffer *buffer = new MediaBuffer(mem); in init() local
83 buffer->getSharedControl()->clear(); in init()
84 add_buffer(buffer); in init()
94 MediaBuffer *buffer = new MediaBuffer(buffer_size); in init() local
95 if (buffer->data() == nullptr) { in init()
96 delete buffer; // don't call release, it's not properly formed in init()
100 add_buffer(buffer); in init()
105 for (MediaBufferBase *buffer : mInternal->mBuffers) { in ~MediaBufferGroup()
106 if (buffer->refcount() != 0) { in ~MediaBufferGroup()
107 const int localRefcount = buffer->localRefcount(); in ~MediaBufferGroup()
[all …]
/frameworks/base/core/jni/
Dandroid_hardware_HardwareBuffer.cpp62 explicit GraphicBufferWrapper(const sp<GraphicBuffer>& buffer) in GraphicBufferWrapper() argument
63 : buffer(buffer) {} in GraphicBufferWrapper()
65 sp<GraphicBuffer> buffer; member in GraphicBufferWrapper
85 sp<GraphicBuffer> buffer = new GraphicBuffer(width, height, pixelFormat, layers, in android_hardware_HardwareBuffer_create() local
87 status_t error = buffer->initCheck(); in android_hardware_HardwareBuffer_create()
95 GraphicBufferWrapper* wrapper = new GraphicBufferWrapper(buffer); in android_hardware_HardwareBuffer_create()
100 sp<GraphicBuffer> buffer(android_graphics_GraphicBuffer_getNativeGraphicsBuffer(env, in android_hardware_HardwareBuffer_createFromGraphicBuffer() local
102 GraphicBufferWrapper* wrapper = new GraphicBufferWrapper(buffer); in android_hardware_HardwareBuffer_createFromGraphicBuffer()
135 return reinterpret_cast<GraphicBufferWrapper*>(nativeObject)->buffer.get(); in GraphicBufferWrapper_to_GraphicBuffer()
140 GraphicBuffer* buffer = GraphicBufferWrapper_to_GraphicBuffer(nativeObject); in android_hardware_HardwareBuffer_getWidth() local
[all …]
/frameworks/base/tests/AccessoryDisplay/common/src/com/android/accessorydisplay/common/
DTransport.java231 protected abstract int ioRead(byte[] buffer, int offset, int count) in ioRead() argument
233 protected abstract void ioWrite(byte[] buffer, int offset, int count) in ioWrite() argument
253 final ByteBuffer buffer = (ByteBuffer)msg.obj; in handleMessage() local
255 final int limit = buffer.limit(); in handleMessage()
256 while (buffer.position() < limit) { in handleMessage()
257 final int service = buffer.getShort() & 0xffff; in handleMessage()
258 final int what = buffer.getShort() & 0xffff; in handleMessage()
259 final int contentSize = buffer.getInt(); in handleMessage()
263 final int end = buffer.position() + contentSize; in handleMessage()
264 buffer.limit(end); in handleMessage()
[all …]
/frameworks/native/libs/ui/tests/
DFlattenableHelpers_test.cpp39 status_t flatten(void* buffer, size_t size) const { in flatten()
40 FlattenableUtils::write(buffer, size, *ptr); in flatten()
44 status_t unflatten(void const* buffer, size_t size) { in unflatten()
46 FlattenableUtils::read(buffer, size, value); in unflatten()
56 std::vector<int8_t> buffer(bufferSize); in testWriteThenRead() local
57 auto rawBuffer = reinterpret_cast<void*>(buffer.data()); in testWriteThenRead()
58 size_t size = buffer.size(); in testWriteThenRead()
61 auto rawReadBuffer = reinterpret_cast<const void*>(buffer.data()); in testWriteThenRead()
62 size = buffer.size(); in testWriteThenRead()
99 std::vector<size_t> buffer; in TEST_F() local
[all …]

12345678910>>...66