Lines Matching defs:bitmap
189 by the device's XY offset and bitmap-bounds.
282 bitmap/device to draw into from this level. This value is NOT
693 SkBitmap bitmap;
694 bitmap.setInfo(SkImageInfo::MakeUnknown(width, height));
695 return bitmap;
752 SkCanvas::SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props)
759 SkAutoTUnref<SkBaseDevice> device(new SkBitmapDevice(bitmap, fProps));
763 SkCanvas::SkCanvas(const SkBitmap& bitmap)
770 SkAutoTUnref<SkBaseDevice> device(new SkBitmapDevice(bitmap, fProps));
842 bool SkCanvas::readPixels(SkBitmap* bitmap, int x, int y) {
843 if (kUnknown_SkColorType == bitmap->colorType() || bitmap->getTexture()) {
848 if (nullptr == bitmap->pixelRef()) {
849 if (!bitmap->tryAllocPixels()) {
856 if (bitmap->requestLock(&unlocker)) {
864 bitmap->setPixelRef(nullptr);
869 bool SkCanvas::readPixels(const SkIRect& srcRect, SkBitmap* bitmap) {
873 bitmap->reset();
877 if (!bitmap->tryAllocN32Pixels(r.width(), r.height())) {
878 // bitmap will already be reset.
881 if (!this->readPixels(bitmap->info(), bitmap->getPixels(), bitmap->rowBytes(), r.x(), r.y())) {
882 bitmap->reset();
904 bool SkCanvas::writePixels(const SkBitmap& bitmap, int x, int y) {
905 if (bitmap.getTexture()) {
910 if (bitmap.requestLock(&unlocker)) {
1926 void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar dx, SkScalar dy, const SkPaint* paint) {
1927 if (bitmap.drawsNothing()) {
1930 this->onDrawBitmap(bitmap, dx, dy, paint);
1933 void SkCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkRect& src, const SkRect& dst,
1935 if (bitmap.drawsNothing() || dst.isEmpty() || src.isEmpty()) {
1938 this->onDrawBitmapRect(bitmap, &src, dst, paint, constraint);
1941 void SkCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkIRect& isrc, const SkRect& dst,
1943 this->drawBitmapRect(bitmap, SkRect::Make(isrc), dst, paint, constraint);
1946 void SkCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, const SkPaint* paint,
1948 this->drawBitmapRect(bitmap, SkRect::MakeIWH(bitmap.width(), bitmap.height()), dst, paint,
1952 void SkCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst,
1954 if (bitmap.drawsNothing() || dst.isEmpty()) {
1957 if (!SkNinePatchIter::Valid(bitmap.width(), bitmap.height(), center)) {
1958 this->drawBitmapRect(bitmap, dst, paint);
1960 this->onDrawBitmapNine(bitmap, center, dst, paint);
1985 void SkCanvas::legacy_drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
1988 this->drawBitmapRect(bitmap, *src, dst, paint, constraint);
1990 this->drawBitmapRect(bitmapbitmap.width(), bitmap.height()),
2191 // Currently we can only use the filterSprite code if we are clipped to the bitmap's bounds.
2224 SkBitmap bitmap;
2225 if (!as_IB(image)->asBitmapForImageFilters(&bitmap)) {
2229 if (bitmap.info().colorType() != kN32_SkColorType || bitmap.info().isSRGB()) {
2240 SkBitmap bitmap;
2241 if (as_IB(image)->asBitmapForImageFilters(&bitmap)) {
2244 iter.fDevice->drawBitmapAsSprite(iter, bitmap,
2283 void SkCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, const SkPaint* paint) {
2285 SkDEBUGCODE(bitmap.validate();)
2287 if (bitmap.drawsNothing()) {
2301 bitmap.getBounds(&storage);
2310 bool drawAsSprite = bounds && this->canDrawBitmapAsSprite(x, y, bitmap.width(), bitmap.height(),
2314 if (bitmap.info().colorType() != kN32_SkColorType || bitmap.info().isSRGB()) {
2326 iter.fDevice->drawBitmapAsSprite(iter, bitmap,
2330 iter.fDevice->drawBitmap(iter, bitmap, matrix, looper.paint());
2338 void SkCanvas::internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
2341 if (bitmap.drawsNothing() || dst.isEmpty()) {
2358 bitmap.isOpaque())
2361 iter.fDevice->drawBitmapRect(iter, bitmap, src, dst, looper.paint(), constraint);
2367 void SkCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst,
2370 SkDEBUGCODE(bitmap.validate();)
2371 this->internalDrawBitmapRect(bitmap, src, dst, paint, constraint);
2399 void SkCanvas::onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst,
2402 SkDEBUGCODE(bitmap.validate();)
2419 iter.fDevice->drawBitmapNine(iter, bitmap, center, dst, looper.paint());
2979 SkBitmap bitmap;
2980 if (!bitmap.installPixels(info, pixels, rowBytes)) {
2983 return new SkCanvas(bitmap);