Lines Matching refs:bitmap
35 static void build_compressed_data(void* buffer, const SkBitmap& bitmap) { in build_compressed_data() argument
36 SkASSERT(kIndex_8_SkColorType == bitmap.colorType()); in build_compressed_data()
38 SkAutoLockPixels alp(bitmap); in build_compressed_data()
39 if (!bitmap.readyToDraw()) { in build_compressed_data()
44 SkColorTable* ctable = bitmap.getColorTable(); in build_compressed_data()
68 if ((unsigned)bitmap.width() == bitmap.rowBytes()) { in build_compressed_data()
69 memcpy(dst, bitmap.getPixels(), bitmap.getSize()); in build_compressed_data()
72 size_t width = bitmap.width(); in build_compressed_data()
73 size_t rowBytes = bitmap.rowBytes(); in build_compressed_data()
74 const char* src = (const char*)bitmap.getPixels(); in build_compressed_data()
75 for (int y = 0; y < bitmap.height(); y++) { in build_compressed_data()
85 static void generate_bitmap_cache_id(const SkBitmap& bitmap, GrCacheID* id) { in generate_bitmap_cache_id() argument
88 uint32_t genID = bitmap.getGenerationID(); in generate_bitmap_cache_id()
89 SkIPoint origin = bitmap.pixelRefOrigin(); in generate_bitmap_cache_id()
90 int16_t width = SkToS16(bitmap.width()); in generate_bitmap_cache_id()
91 int16_t height = SkToS16(bitmap.height()); in generate_bitmap_cache_id()
106 static void generate_bitmap_texture_desc(const SkBitmap& bitmap, GrTextureDesc* desc) { in generate_bitmap_texture_desc() argument
108 desc->fWidth = bitmap.width(); in generate_bitmap_texture_desc()
109 desc->fHeight = bitmap.height(); in generate_bitmap_texture_desc()
110 desc->fConfig = SkImageInfo2GrPixelConfig(bitmap.info()); in generate_bitmap_texture_desc()
202 const SkBitmap* bitmap = &origBitmap; in sk_gr_create_bitmap_texture() local
205 generate_bitmap_texture_desc(*bitmap, &desc); in sk_gr_create_bitmap_texture()
207 if (kIndex_8_SkColorType == bitmap->colorType()) { in sk_gr_create_bitmap_texture()
210 if (ctx->supportsIndex8PixelConfig(params, bitmap->width(), bitmap->height())) { in sk_gr_create_bitmap_texture()
211 size_t imagesize = bitmap->width() * bitmap->height() + kGrColorTableSize; in sk_gr_create_bitmap_texture()
225 storage.get(), bitmap->width(), &key); in sk_gr_create_bitmap_texture()
233 result->writePixels(0, 0, bitmap->width(), in sk_gr_create_bitmap_texture()
234 bitmap->height(), desc.fConfig, in sk_gr_create_bitmap_texture()
241 bitmap = &tmpBitmap; in sk_gr_create_bitmap_texture()
242 desc.fConfig = SkImageInfo2GrPixelConfig(bitmap->info()); in sk_gr_create_bitmap_texture()
259 && !(bitmap->readyToDraw())) { in sk_gr_create_bitmap_texture()
260 GrTexture *texture = load_etc1_texture(ctx, params, *bitmap, desc); in sk_gr_create_bitmap_texture()
267 SkAutoLockPixels alp(*bitmap); in sk_gr_create_bitmap_texture()
268 if (!bitmap->readyToDraw()) { in sk_gr_create_bitmap_texture()
278 bitmap->getPixels(), bitmap->rowBytes(), &key); in sk_gr_create_bitmap_texture()
291 bitmap->width(), bitmap->height(), in sk_gr_create_bitmap_texture()
293 bitmap->getPixels(), in sk_gr_create_bitmap_texture()
294 bitmap->rowBytes()); in sk_gr_create_bitmap_texture()
300 const SkBitmap& bitmap, in GrIsBitmapInCache() argument
303 generate_bitmap_cache_id(bitmap, &cacheID); in GrIsBitmapInCache()
306 generate_bitmap_texture_desc(bitmap, &desc); in GrIsBitmapInCache()
311 const SkBitmap& bitmap, in GrLockAndRefCachedBitmapTexture() argument
315 bool cache = !bitmap.isVolatile(); in GrLockAndRefCachedBitmapTexture()
321 generate_bitmap_cache_id(bitmap, &cacheID); in GrLockAndRefCachedBitmapTexture()
324 generate_bitmap_texture_desc(bitmap, &desc); in GrLockAndRefCachedBitmapTexture()
329 result = sk_gr_create_bitmap_texture(ctx, cache, params, bitmap); in GrLockAndRefCachedBitmapTexture()
333 bitmap.width(), bitmap.height()); in GrLockAndRefCachedBitmapTexture()