Lines Matching refs:handle

95 uint32_t GetPixelValue(const BufferHandle &handle, int x, int y)
98 int32_t bpp = GetPixelFormatBpp((Composer::V1_0::PixelFormat)handle.format);
100 handle.format));
101 DISPLAY_TEST_CHK_RETURN((handle.virAddr == nullptr), 0,
103 DISPLAY_TEST_CHK_RETURN((x < 0 || x >= handle.width), 0,
104 DISPLAY_TEST_LOGE("CheckPixel invalid parameter x:%{public}d width:%{public}d", x, handle.width));
105 DISPLAY_TEST_CHK_RETURN((y < 0 || y >= handle.height), 0,
106 DISPLAY_TEST_LOGE("CheckPixel invalid parameter y:%{public}d height:%{public}d", y, handle.height));
108 int32_t position = y * handle.width + x;
109 if ((position * PIXEL_BYTES) > handle.size) {
112 uint32_t *pixel = reinterpret_cast<uint32_t *>(handle.virAddr) + position;
128 uint32_t CheckPixel(const BufferHandle &handle, int x, int y, uint32_t color)
131 int32_t bpp = GetPixelFormatBpp(static_cast<Composer::V1_0::PixelFormat>(handle.format));
133 handle.format));
134 DISPLAY_TEST_CHK_RETURN((handle.virAddr == nullptr), 0,
136 DISPLAY_TEST_CHK_RETURN((x < 0 || x >= handle.width), 0,
137 DISPLAY_TEST_LOGE("CheckPixel invalid parameter x:%{public}d width:%{public}d", x, handle.width));
138 DISPLAY_TEST_CHK_RETURN((y < 0 || y >= handle.height), 0,
139 DISPLAY_TEST_LOGE("CheckPixel invalid parameter y:%{public}d height:%{public}d", y, handle.height));
141 int32_t position = y * handle.width + x;
142 if ((position * PIXEL_BYTES) > handle.size) {
145 uint32_t *pixel = reinterpret_cast<uint32_t *>(handle.virAddr) + position;
148 uint32_t checkColor = ConverToRGBA(static_cast<Composer::V1_0::PixelFormat>(handle.format), GetUint32(*pixel));
150 DISPLAY_TEST_LOGD("x:%{public}d y:%{public}d width:%{public}d", x, y, handle.width);
151 SaveFile("/data/display_test_bitmap_", static_cast<uint8_t *>(handle.virAddr), handle.size);
169 void SetPixel(const BufferHandle &handle, int x, int y, uint32_t color)
174 DISPLAY_TEST_LOGE("CheckPixel do not support format %{public}d", handle.format));
175 DISPLAY_TEST_CHK_RETURN_NOT_VALUE((handle.virAddr == nullptr),
177 DISPLAY_TEST_CHK_RETURN_NOT_VALUE((x < 0 || x >= handle.width),
178 DISPLAY_TEST_LOGE("CheckPixel invalid parameter x:%{public}d width:%{public}d", x, handle.width));
179 DISPLAY_TEST_CHK_RETURN_NOT_VALUE((y < 0 || y >= handle.height),
180 DISPLAY_TEST_LOGE("CheckPixel invalid parameter y:%{public}d height:%{public}d", y, handle.height));
182 int32_t position = y * handle.stride / PIXEL_BYTES + x;
183 if ((position * PIXEL_BYTES) > handle.size) {
186 uint32_t *pixel = reinterpret_cast<uint32_t *>(handle.virAddr) + position;
192 void ClearColor(const BufferHandle &handle, uint32_t color)
194 for (int32_t x = 0; x < handle.width; x++) {
195 for (int32_t y = 0; y < handle.height; y++) {
196 SetPixel(handle, x, y, color);
201 void ClearColorRect(const BufferHandle &handle, uint32_t color, const IRect &rect)
207 SetPixel(handle, x + rect.x, y + rect.y, color);
212 std::vector<IRect> SplitBuffer(const BufferHandle &handle, std::vector<uint32_t> &colors)
225 const uint32_t CELL_WIDTH = handle.width / ROW_NUM;
226 const uint32_t CELL_HEIGHT = handle.height / COL_NUM;
235 ClearColorRect(handle, colors[count++], rect);
239 SaveFile("/data/splitbuffer_data_", static_cast<uint8_t *>(handle.virAddr), handle.size);