Home | History | Annotate | Download | only in gpu

Lines Matching refs:bitmap

88                         const SkBitmap& bitmap,
94 *texture = this->set(device, bitmap, params);
104 const SkBitmap& bitmap,
111 GrTexture* result = (GrTexture*)bitmap.getTexture();
114 fTexture = GrLockAndRefCachedBitmapTexture(device->context(), bitmap, params);
162 SkBitmap bitmap;
163 bitmap.setConfig(grConfig2skConfig(config, &isOpaque),
165 bitmap.setIsOpaque(isOpaque);
166 return bitmap;
241 // wrap the bitmap with a pixelref to expose our texture
308 bool SkGpuDevice::onReadPixels(const SkBitmap& bitmap,
312 SkASSERT(SkBitmap::kARGB_8888_Config == bitmap.config());
313 SkASSERT(!bitmap.isNull());
314 SkASSERT(SkIRect::MakeWH(this->width(), this->height()).contains(SkIRect::MakeXYWH(x, y, bitmap.width(), bitmap.height())));
316 SkAutoLockPixels alp(bitmap);
322 bitmap.width(),
323 bitmap.height(),
325 bitmap.getPixels(),
326 bitmap.rowBytes(),
330 void SkGpuDevice::writePixels(const SkBitmap& bitmap, int x, int y,
332 SkAutoLockPixels alp(bitmap);
333 if (!bitmap.readyToDraw()) {
339 if (SkBitmap::kARGB_8888_Config == bitmap.config()) {
343 config= SkBitmapConfig2GrPixelConfig(bitmap.config());
346 fRenderTarget->writePixels(x, y, bitmap.width(), bitmap.height(),
347 config, bitmap.getPixels(), bitmap.rowBytes(), flags);
1020 inline int determine_tile_size(const SkBitmap& bitmap,
1056 bool SkGpuDevice::shouldTileBitmap(const SkBitmap& bitmap,
1059 // if bitmap is explictly texture backed then just use the texture
1060 if (NULL != bitmap.getTexture()) {
1066 if (bitmap.width() > maxTextureSize ||
1067 bitmap.height() > maxTextureSize) {
1075 if (GrIsBitmapInCache(fContext, bitmap, &params)) {
1079 // At this point we know we could do the draw by uploading the entire bitmap
1084 // assumption here is that sw bitmap size is a good proxy for its size as
1086 size_t bmpSize = bitmap.getSize();
1093 SkScalar fracUsed = SkScalarMul(srcRectPtr->width() / bitmap.width(),
1094 srcRectPtr->height() / bitmap.height());
1103 const SkBitmap& bitmap,
1118 this->drawBitmapCommon(draw, bitmap, tmpPtr, m, paint);
1122 const SkBitmap& bitmap,
1130 srcRect.set(0, 0, SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()));
1136 // Convert the bitmap to a shader so that the rect can be drawn
1139 SkBitmap tmp; // subset of bitmap, if necessary
1140 const SkBitmap* bitmapPtr = &bitmap;
1144 if (!bitmap.extractSubset(&tmp, iSrc)) {
1172 bool alphaOnly = !(SkBitmap::kA8_Config == bitmap.config());
1179 if (!this->shouldTileBitmap(bitmap, params, srcRectPtr)) {
1181 this->internalDrawBitmap(bitmap, srcRect, m, params, &grPaint);
1183 this->drawTiledBitmap(bitmap, srcRect, m, params, &grPaint);
1187 // Break 'bitmap' into several tiles to draw it since it has already
1189 void SkGpuDevice::drawTiledBitmap(const SkBitmap& bitmap,
1196 int tileSize = determine_tile_size(bitmap, srcRect, maxTextureSize);
1214 int nx = bitmap.width() / tileSize;
1215 int ny = bitmap.height() / tileSize;
1235 if (bitmap.extractSubset(&tmpB, iTileR)) {
1236 // now offset it to make it "local" to our tmp bitmap
1295 * internalDrawBitmap assumes that the specified bitmap will fit in a texture
1298 void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
1303 SkASSERT(bitmap.width() <= fContext->getMaxTextureSize() &&
1304 bitmap.height() <= fContext->getMaxTextureSize());
1306 SkAutoLockPixels alp(bitmap, !bitmap.getTexture());
1307 if (!bitmap.getTexture() && !bitmap.readyToDraw()) {
1313 SkAutoCachedTexture act(this, bitmap, &params, &texture);
1320 SkScalar wInv = SkScalarInvert(SkIntToScalar(bitmap.width()));
1321 SkScalar hInv = SkScalarInvert(SkIntToScalar(bitmap.height()));
1330 needsTextureDomain = srcRect.width() < bitmap.width() ||
1331 srcRect.height() < bitmap.height();
1356 SkScalar border = SK_ScalarHalf / bitmap.width();
1363 SkScalar border = SK_ScalarHalf / bitmap.height();
1442 void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
1447 SkAutoLockPixels alp(bitmap, !bitmap.getTexture());
1448 if (!bitmap.getTexture() && !bitmap.readyToDraw()) {
1452 int w = bitmap.width();
1453 int h = bitmap.height();
1465 SkAutoCachedTexture act(this, bitmap, NULL, &texture);
1490 void SkGpuDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
1497 SkIntToScalar(bitmap.width()),
1498 SkIntToScalar(bitmap.height()));
1508 // clip the tmpSrc to the bounds of the bitmap. No check needed if src==null.
1517 this->drawBitmapCommon(draw, bitmap, &tmpSrc, matrix, paint);