Home | History | Annotate | Download | only in gl

Lines Matching full:bitmap

175 size_t SkGL::ComputeTextureMemorySize(const SkBitmap& bitmap) {
178 switch (bitmap.config()) {
197 return (bitmap.getSize() << shift) + adder;
202 based bitmap. [palette (colortable) + indices].
214 static void build_compressed_data(void* buffer, const SkBitmap& bitmap) {
215 SkASSERT(SkBitmap::kIndex8_Config == bitmap.config());
217 SkColorTable* ctable = bitmap.getColorTable();
225 memcpy(dst, bitmap.getPixels(), bitmap.getSize());
229 /* Return true if the bitmap cannot be supported in its current config as a
232 static bool needToPromoteTo32bit(const SkBitmap& bitmap) {
233 if (bitmap.config() == SkBitmap::kIndex8_Config) {
235 const int w = bitmap.width();
236 const int h = bitmap.height();
249 const SkBitmap* bitmap = &origBitmap;
253 // now bitmap points to our temp, which has been promoted to 32bits
254 bitmap = &tmpBitmap;
258 if (!canBeTexture(*bitmap, &format, &type)) {
262 SkAutoLockPixels alp(*bitmap);
263 if (!bitmap->readyToDraw()) {
273 int ow = bitmap->rowBytesAsPixels();
274 int oh = bitmap->height();
278 glPixelStorei(GL_UNPACK_ALIGNMENT, bitmap->bytesPerPixel());
282 if (SkBitmap::kIndex8_Config == bitmap->config()) {
283 size_t imagesize = bitmap->getSize() + SK_GL_SIZE_OF_PALETTE;
286 build_compressed_data(storage.get(), *bitmap);
299 format, type, bitmap->getPixels());
301 // easy case, the bitmap is already pow2
303 format, type, bitmap->getPixels());
309 bitmap->bytesPerPixel());
313 max->fX = SkFixedToScalar(bitmap->width() << (16 - SkNextLog2(nw)));