Lines Matching defs:bitmap
144 // With OpenGL ES 2.0 we need to copy the bitmap in a temporary buffer
168 static void uploadSkBitmapToTexture(const SkBitmap& bitmap,
170 uploadToTexture(resize, format, type, bitmap.rowBytesAsPixels(), bitmap.bytesPerPixel(),
171 bitmap.width(), bitmap.height(), bitmap.getPixels());
197 LOG_ALWAYS_FATAL("Unsupported bitmap colorType: %d", colorType);
202 void Texture::upload(const SkBitmap& bitmap) {
203 SkAutoLockPixels alp(bitmap);
205 if (!bitmap.readyToDraw()) {
206 ALOGE("Cannot generate texture from bitmap");
210 ATRACE_FORMAT("Upload %ux%u Texture", bitmap.width(), bitmap.height());
212 // We could also enable mipmapping if both bitmap dimensions are powers
218 bool needsAlloc = canMipMap && mipMap && !bitmap.hasHardwareMipMap();
228 colorTypeToGlFormatAndType(bitmap.colorType(), &format, &type);
230 if (updateSize(bitmap.width(), bitmap.height(), format)) {
234 blend = !bitmap.isOpaque();
237 if (CC_UNLIKELY(bitmap.colorType() == kARGB_4444_SkColorType
238 || bitmap.colorType() == kIndex_8_SkColorType)) {
241 bitmap.alphaType()));
245 canvas.drawBitmap(bitmap, 0.0f, 0.0f, nullptr);
249 uploadSkBitmapToTexture(bitmap, needsAlloc, format, type);
253 mipMap = bitmap.hasHardwareMipMap();