Home | History | Annotate | Download | only in gpu

Lines Matching defs:bitmap

25  based bitmap. [palette (colortable) + indices].
35 static void build_compressed_data(void* buffer, const SkBitmap& bitmap) {
36 SkASSERT(kIndex_8_SkColorType == bitmap.colorType());
38 SkAutoLockPixels alp(bitmap);
39 if (!bitmap.readyToDraw()) {
40 SkDEBUGFAIL("bitmap not ready to draw!");
44 SkColorTable* ctable = bitmap.getColorTable();
68 if ((unsigned)bitmap.width() == bitmap.rowBytes()) {
69 memcpy(dst, bitmap.getPixels(), bitmap.getSize());
72 size_t width = bitmap.width();
73 size_t rowBytes = bitmap.rowBytes();
74 const char* src = (const char*)bitmap.getPixels();
75 for (int y = 0; y < bitmap.height(); y++) {
85 static void generate_bitmap_cache_id(const SkBitmap& bitmap, GrCacheID* id) {
88 uint32_t genID = bitmap.getGenerationID();
89 SkIPoint origin = bitmap.pixelRefOrigin();
90 int16_t width = SkToS16(bitmap.width());
91 int16_t height = SkToS16(bitmap.height());
106 static void generate_bitmap_texture_desc(const SkBitmap& bitmap, GrTextureDesc* desc) {
108 desc->fWidth = bitmap.width();
109 desc->fHeight = bitmap.height();
110 desc->fConfig = SkImageInfo2GrPixelConfig(bitmap.info());
153 // Does the data match the dimensions of the bitmap? If not,
171 // Does the data match the dimensions of the bitmap? If not,
202 const SkBitmap* bitmap = &origBitmap;
205 generate_bitmap_texture_desc(*bitmap, &desc);
207 if (kIndex_8_SkColorType == bitmap->colorType()) {
210 if (ctx->supportsIndex8PixelConfig(params, bitmap->width(), bitmap->height())) {
211 size_t imagesize = bitmap->width() * bitmap->height() + kGrColorTableSize;
225 storage.get(), bitmap->width(), &key);
233 result->writePixels(0, 0, bitmap->width(),
234 bitmap->height(), desc.fConfig,
240 // now bitmap points to our temp, which has been promoted to 32bits
241 bitmap = &tmpBitmap;
242 desc.fConfig = SkImageInfo2GrPixelConfig(bitmap->info());
255 // If the bitmap had compressed data and was then uncompressed, it'll still return
257 // the bitmap has available pixels, then they might not be what the decompressed
259 && !(bitmap->readyToDraw())) {
260 GrTexture *texture = load_etc1_texture(ctx, params, *bitmap, desc);
267 SkAutoLockPixels alp(*bitmap);
268 if (!bitmap->readyToDraw()) {
278 bitmap->getPixels(), bitmap->rowBytes(), &key);
288 // likely be available for this volatile bitmap the next time around.
291 bitmap->width(), bitmap->height(),
293 bitmap->getPixels(),
294 bitmap->rowBytes());
300 const SkBitmap& bitmap,
303 generate_bitmap_cache_id(bitmap, &cacheID);
306 generate_bitmap_texture_desc(bitmap, &desc);
311 const SkBitmap& bitmap,
315 bool cache = !bitmap.isVolatile();
318 // If the bitmap isn't changing try to find a cached copy first.
321 generate_bitmap_cache_id(bitmap, &cacheID);
324 generate_bitmap_texture_desc(bitmap, &desc);
329 result = sk_gr_create_bitmap_texture(ctx, cache, params, bitmap);
333 bitmap.width(), bitmap.height());