reed@google.com | 5d4ba88 | 2012-07-31 15:45:27 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
reed | 6f1216a | 2015-08-04 08:10:13 -0700 | [diff] [blame] | 8 | #include "SkBitmapCache.h" |
bsalomon | eaaaf0b | 2015-01-23 08:08:04 -0800 | [diff] [blame] | 9 | #include "SkImage_Gpu.h" |
robertphillips@google.com | 97b6b07 | 2012-10-31 14:48:39 +0000 | [diff] [blame] | 10 | #include "GrContext.h" |
bsalomon | 993a421 | 2015-05-29 11:37:25 -0700 | [diff] [blame] | 11 | #include "GrDrawContext.h" |
| 12 | #include "effects/GrYUVtoRGBEffect.h" |
| 13 | #include "SkCanvas.h" |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 14 | #include "SkGpuDevice.h" |
reed | 6f1216a | 2015-08-04 08:10:13 -0700 | [diff] [blame] | 15 | #include "SkPixelRef.h" |
bsalomon | 993a421 | 2015-05-29 11:37:25 -0700 | [diff] [blame] | 16 | |
reed | 80c772b | 2015-07-30 18:58:23 -0700 | [diff] [blame] | 17 | SkImage_Gpu::SkImage_Gpu(int w, int h, uint32_t uniqueID, SkAlphaType at, GrTexture* tex, |
reed | 7b6945b | 2015-09-24 00:50:58 -0700 | [diff] [blame] | 18 | SkSurface::Budgeted budgeted) |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 19 | : INHERITED(w, h, uniqueID, nullptr) |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 20 | , fTexture(SkRef(tex)) |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 21 | , fAlphaType(at) |
bsalomon | eaaaf0b | 2015-01-23 08:08:04 -0800 | [diff] [blame] | 22 | , fBudgeted(budgeted) |
bsalomon | 1cd6311 | 2015-08-05 06:58:39 -0700 | [diff] [blame] | 23 | , fAddedRasterVersionToCache(false) |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 24 | {} |
piotaixr | cef04f8 | 2014-07-14 07:48:04 -0700 | [diff] [blame] | 25 | |
reed | 6f1216a | 2015-08-04 08:10:13 -0700 | [diff] [blame] | 26 | SkImage_Gpu::~SkImage_Gpu() { |
| 27 | if (fAddedRasterVersionToCache.load()) { |
| 28 | SkNotifyBitmapGenIDIsStale(this->uniqueID()); |
| 29 | } |
| 30 | } |
| 31 | |
bsalomon | eaaaf0b | 2015-01-23 08:08:04 -0800 | [diff] [blame] | 32 | extern void SkTextureImageApplyBudgetedDecision(SkImage* image) { |
bsalomon | 5581236 | 2015-06-10 08:49:28 -0700 | [diff] [blame] | 33 | if (as_IB(image)->getTexture()) { |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 34 | ((SkImage_Gpu*)image)->applyBudgetDecision(); |
| 35 | } |
| 36 | } |
| 37 | |
reed | 476506d | 2015-09-28 10:26:51 -0700 | [diff] [blame] | 38 | SkShader* SkImage_Gpu::onNewShader(SkShader::TileMode tileX, SkShader::TileMode tileY, |
| 39 | const SkMatrix* localMatrix) const { |
| 40 | SkBitmap bm; |
| 41 | GrWrapTextureInBitmap(fTexture, this->width(), this->height(), this->isOpaque(), &bm); |
| 42 | return SkShader::CreateBitmapShader(bm, tileX, tileY, localMatrix); |
| 43 | } |
| 44 | |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 45 | bool SkImage_Gpu::getROPixels(SkBitmap* dst) const { |
reed | 6f1216a | 2015-08-04 08:10:13 -0700 | [diff] [blame] | 46 | if (SkBitmapCache::Find(this->uniqueID(), dst)) { |
| 47 | SkASSERT(dst->getGenerationID() == this->uniqueID()); |
| 48 | SkASSERT(dst->isImmutable()); |
| 49 | SkASSERT(dst->getPixels()); |
| 50 | return true; |
| 51 | } |
| 52 | |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 53 | SkAlphaType at = this->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType; |
| 54 | if (!dst->tryAllocPixels(SkImageInfo::MakeN32(this->width(), this->height(), at))) { |
| 55 | return false; |
| 56 | } |
| 57 | if (!fTexture->readPixels(0, 0, dst->width(), dst->height(), kSkia8888_GrPixelConfig, |
| 58 | dst->getPixels(), dst->rowBytes())) { |
| 59 | return false; |
| 60 | } |
reed | 6f1216a | 2015-08-04 08:10:13 -0700 | [diff] [blame] | 61 | |
| 62 | dst->pixelRef()->setImmutableWithID(this->uniqueID()); |
| 63 | SkBitmapCache::Add(this->uniqueID(), *dst); |
| 64 | fAddedRasterVersionToCache.store(true); |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 65 | return true; |
| 66 | } |
| 67 | |
reed | 85d9178 | 2015-09-10 14:33:38 -0700 | [diff] [blame] | 68 | GrTexture* SkImage_Gpu::asTextureRef(GrContext* ctx, SkImageUsageType usage) const { |
| 69 | fTexture->ref(); |
| 70 | return fTexture; |
| 71 | } |
| 72 | |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 73 | bool SkImage_Gpu::isOpaque() const { |
bsalomon | 74f681d | 2015-06-23 14:38:48 -0700 | [diff] [blame] | 74 | return GrPixelConfigIsOpaque(fTexture->config()) || fAlphaType == kOpaque_SkAlphaType; |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | static void apply_premul(const SkImageInfo& info, void* pixels, size_t rowBytes) { |
| 78 | switch (info.colorType()) { |
| 79 | case kRGBA_8888_SkColorType: |
| 80 | case kBGRA_8888_SkColorType: |
| 81 | break; |
| 82 | default: |
| 83 | return; // nothing to do |
| 84 | } |
| 85 | |
| 86 | // SkColor is not necesarily RGBA or BGRA, but it is one of them on little-endian, |
| 87 | // and in either case, the alpha-byte is always in the same place, so we can safely call |
| 88 | // SkPreMultiplyColor() |
| 89 | // |
| 90 | SkColor* row = (SkColor*)pixels; |
| 91 | for (int y = 0; y < info.height(); ++y) { |
| 92 | for (int x = 0; x < info.width(); ++x) { |
| 93 | row[x] = SkPreMultiplyColor(row[x]); |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | bool SkImage_Gpu::onReadPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, |
| 99 | int srcX, int srcY) const { |
| 100 | GrPixelConfig config = SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(), |
| 101 | info.profileType()); |
| 102 | uint32_t flags = 0; |
| 103 | if (kUnpremul_SkAlphaType == info.alphaType() && kPremul_SkAlphaType == fAlphaType) { |
| 104 | // let the GPU perform this transformation for us |
| 105 | flags = GrContext::kUnpremul_PixelOpsFlag; |
| 106 | } |
| 107 | if (!fTexture->readPixels(srcX, srcY, info.width(), info.height(), config, |
| 108 | pixels, rowBytes, flags)) { |
| 109 | return false; |
| 110 | } |
| 111 | // do we have to manually fix-up the alpha channel? |
| 112 | // src dst |
| 113 | // unpremul premul fix manually |
| 114 | // premul unpremul done by kUnpremul_PixelOpsFlag |
| 115 | // all other combos need to change. |
| 116 | // |
| 117 | // Should this be handled by Ganesh? todo:? |
| 118 | // |
| 119 | if (kPremul_SkAlphaType == info.alphaType() && kUnpremul_SkAlphaType == fAlphaType) { |
| 120 | apply_premul(info, pixels, rowBytes); |
| 121 | } |
| 122 | return true; |
| 123 | } |
| 124 | |
reed | 7b6945b | 2015-09-24 00:50:58 -0700 | [diff] [blame] | 125 | SkImage* SkImage_Gpu::onNewSubset(const SkIRect& subset) const { |
| 126 | GrContext* ctx = fTexture->getContext(); |
| 127 | GrSurfaceDesc desc = fTexture->desc(); |
| 128 | desc.fWidth = subset.width(); |
| 129 | desc.fHeight = subset.height(); |
| 130 | |
| 131 | GrTexture* subTx = ctx->textureProvider()->createTexture(desc, |
| 132 | SkSurface::kYes_Budgeted == fBudgeted); |
| 133 | if (!subTx) { |
| 134 | return nullptr; |
| 135 | } |
| 136 | ctx->copySurface(subTx, fTexture, subset, SkIPoint::Make(0, 0)); |
| 137 | return new SkImage_Gpu(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID, fAlphaType, subTx, |
| 138 | fBudgeted); |
| 139 | } |
| 140 | |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 141 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
| 142 | |
bsalomon | 6dc6f5f | 2015-06-18 09:12:16 -0700 | [diff] [blame] | 143 | static SkImage* new_wrapped_texture_common(GrContext* ctx, const GrBackendTextureDesc& desc, |
reed | de49988 | 2015-06-18 13:41:40 -0700 | [diff] [blame] | 144 | SkAlphaType at, GrWrapOwnership ownership, |
| 145 | SkImage::TextureReleaseProc releaseProc, |
| 146 | SkImage::ReleaseContext releaseCtx) { |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 147 | if (desc.fWidth <= 0 || desc.fHeight <= 0) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 148 | return nullptr; |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 149 | } |
bsalomon | 6dc6f5f | 2015-06-18 09:12:16 -0700 | [diff] [blame] | 150 | SkAutoTUnref<GrTexture> tex(ctx->textureProvider()->wrapBackendTexture(desc, ownership)); |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 151 | if (!tex) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 152 | return nullptr; |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 153 | } |
reed | de49988 | 2015-06-18 13:41:40 -0700 | [diff] [blame] | 154 | if (releaseProc) { |
| 155 | tex->setRelease(releaseProc, releaseCtx); |
| 156 | } |
| 157 | |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 158 | const SkSurface::Budgeted budgeted = SkSurface::kNo_Budgeted; |
reed | 7b6945b | 2015-09-24 00:50:58 -0700 | [diff] [blame] | 159 | return new SkImage_Gpu(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID, at, tex, budgeted); |
bsalomon | 6dc6f5f | 2015-06-18 09:12:16 -0700 | [diff] [blame] | 160 | } |
| 161 | |
reed | de49988 | 2015-06-18 13:41:40 -0700 | [diff] [blame] | 162 | SkImage* SkImage::NewFromTexture(GrContext* ctx, const GrBackendTextureDesc& desc, SkAlphaType at, |
| 163 | TextureReleaseProc releaseP, ReleaseContext releaseC) { |
| 164 | return new_wrapped_texture_common(ctx, desc, at, kBorrow_GrWrapOwnership, releaseP, releaseC); |
bsalomon | 6dc6f5f | 2015-06-18 09:12:16 -0700 | [diff] [blame] | 165 | } |
| 166 | |
| 167 | SkImage* SkImage::NewFromAdoptedTexture(GrContext* ctx, const GrBackendTextureDesc& desc, |
| 168 | SkAlphaType at) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 169 | return new_wrapped_texture_common(ctx, desc, at, kAdopt_GrWrapOwnership, nullptr, nullptr); |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 170 | } |
| 171 | |
reed | 5617900 | 2015-07-07 06:11:19 -0700 | [diff] [blame] | 172 | SkImage* SkImage::NewFromTextureCopy(GrContext* ctx, const GrBackendTextureDesc& desc, |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 173 | SkAlphaType at) { |
reed | 5617900 | 2015-07-07 06:11:19 -0700 | [diff] [blame] | 174 | if (desc.fWidth <= 0 || desc.fHeight <= 0) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 175 | return nullptr; |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 176 | } |
reed | 5617900 | 2015-07-07 06:11:19 -0700 | [diff] [blame] | 177 | |
bsalomon | 6dc6f5f | 2015-06-18 09:12:16 -0700 | [diff] [blame] | 178 | SkAutoTUnref<GrTexture> src(ctx->textureProvider()->wrapBackendTexture( |
reed | 5617900 | 2015-07-07 06:11:19 -0700 | [diff] [blame] | 179 | desc, kBorrow_GrWrapOwnership)); |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 180 | if (!src) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 181 | return nullptr; |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 182 | } |
| 183 | |
reed | 5617900 | 2015-07-07 06:11:19 -0700 | [diff] [blame] | 184 | const bool isBudgeted = true; |
| 185 | SkAutoTUnref<GrTexture> dst(GrDeepCopyTexture(src, isBudgeted)); |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 186 | if (!dst) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 187 | return nullptr; |
reed | 8b26b99 | 2015-05-07 15:36:17 -0700 | [diff] [blame] | 188 | } |
| 189 | |
reed | 5617900 | 2015-07-07 06:11:19 -0700 | [diff] [blame] | 190 | const SkSurface::Budgeted budgeted = SkSurface::kYes_Budgeted; |
reed | 7b6945b | 2015-09-24 00:50:58 -0700 | [diff] [blame] | 191 | return new SkImage_Gpu(desc.fWidth, desc.fHeight, kNeedNewImageUniqueID, at, dst, |
halcanary | 385fe4d | 2015-08-26 13:07:48 -0700 | [diff] [blame] | 192 | budgeted); |
bsalomon | eaaaf0b | 2015-01-23 08:08:04 -0800 | [diff] [blame] | 193 | } |
bsalomon | 993a421 | 2015-05-29 11:37:25 -0700 | [diff] [blame] | 194 | |
| 195 | SkImage* SkImage::NewFromYUVTexturesCopy(GrContext* ctx , SkYUVColorSpace colorSpace, |
| 196 | const GrBackendObject yuvTextureHandles[3], |
| 197 | const SkISize yuvSizes[3], |
| 198 | GrSurfaceOrigin origin) { |
| 199 | const SkSurface::Budgeted budgeted = SkSurface::kYes_Budgeted; |
| 200 | |
| 201 | if (yuvSizes[0].fWidth <= 0 || yuvSizes[0].fHeight <= 0 || |
| 202 | yuvSizes[1].fWidth <= 0 || yuvSizes[1].fHeight <= 0 || |
| 203 | yuvSizes[2].fWidth <= 0 || yuvSizes[2].fHeight <= 0) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 204 | return nullptr; |
bsalomon | 993a421 | 2015-05-29 11:37:25 -0700 | [diff] [blame] | 205 | } |
| 206 | static const GrPixelConfig kConfig = kAlpha_8_GrPixelConfig; |
| 207 | GrBackendTextureDesc yDesc; |
| 208 | yDesc.fConfig = kConfig; |
| 209 | yDesc.fOrigin = origin; |
| 210 | yDesc.fSampleCnt = 0; |
| 211 | yDesc.fTextureHandle = yuvTextureHandles[0]; |
| 212 | yDesc.fWidth = yuvSizes[0].fWidth; |
| 213 | yDesc.fHeight = yuvSizes[0].fHeight; |
| 214 | |
| 215 | GrBackendTextureDesc uDesc; |
| 216 | uDesc.fConfig = kConfig; |
| 217 | uDesc.fOrigin = origin; |
| 218 | uDesc.fSampleCnt = 0; |
| 219 | uDesc.fTextureHandle = yuvTextureHandles[1]; |
| 220 | uDesc.fWidth = yuvSizes[1].fWidth; |
| 221 | uDesc.fHeight = yuvSizes[1].fHeight; |
| 222 | |
| 223 | GrBackendTextureDesc vDesc; |
| 224 | vDesc.fConfig = kConfig; |
| 225 | vDesc.fOrigin = origin; |
| 226 | vDesc.fSampleCnt = 0; |
| 227 | vDesc.fTextureHandle = yuvTextureHandles[2]; |
| 228 | vDesc.fWidth = yuvSizes[2].fWidth; |
| 229 | vDesc.fHeight = yuvSizes[2].fHeight; |
| 230 | |
bsalomon | 6dc6f5f | 2015-06-18 09:12:16 -0700 | [diff] [blame] | 231 | SkAutoTUnref<GrTexture> yTex(ctx->textureProvider()->wrapBackendTexture( |
| 232 | yDesc, kBorrow_GrWrapOwnership)); |
| 233 | SkAutoTUnref<GrTexture> uTex(ctx->textureProvider()->wrapBackendTexture( |
| 234 | uDesc, kBorrow_GrWrapOwnership)); |
| 235 | SkAutoTUnref<GrTexture> vTex(ctx->textureProvider()->wrapBackendTexture( |
| 236 | vDesc, kBorrow_GrWrapOwnership)); |
bsalomon | 993a421 | 2015-05-29 11:37:25 -0700 | [diff] [blame] | 237 | if (!yTex || !uTex || !vTex) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 238 | return nullptr; |
bsalomon | 993a421 | 2015-05-29 11:37:25 -0700 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | GrSurfaceDesc dstDesc; |
| 242 | // Needs to be a render target in order to draw to it for the yuv->rgb conversion. |
| 243 | dstDesc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 244 | dstDesc.fOrigin = origin; |
| 245 | dstDesc.fWidth = yuvSizes[0].fWidth; |
| 246 | dstDesc.fHeight = yuvSizes[0].fHeight; |
| 247 | dstDesc.fConfig = kRGBA_8888_GrPixelConfig; |
| 248 | dstDesc.fSampleCnt = 0; |
| 249 | |
bsalomon | eae6200 | 2015-07-31 13:59:30 -0700 | [diff] [blame] | 250 | SkAutoTUnref<GrTexture> dst(ctx->textureProvider()->createTexture(dstDesc, true)); |
bsalomon | 993a421 | 2015-05-29 11:37:25 -0700 | [diff] [blame] | 251 | if (!dst) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 252 | return nullptr; |
bsalomon | 993a421 | 2015-05-29 11:37:25 -0700 | [diff] [blame] | 253 | } |
| 254 | |
| 255 | GrPaint paint; |
| 256 | paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); |
bsalomon | ac856c9 | 2015-08-27 06:30:17 -0700 | [diff] [blame] | 257 | paint.addColorFragmentProcessor(GrYUVtoRGBEffect::Create(paint.getProcessorDataManager(), |
| 258 | yTex, uTex, vTex, yuvSizes, |
| 259 | colorSpace))->unref(); |
bsalomon | 993a421 | 2015-05-29 11:37:25 -0700 | [diff] [blame] | 260 | |
| 261 | const SkRect rect = SkRect::MakeWH(SkIntToScalar(dstDesc.fWidth), |
| 262 | SkIntToScalar(dstDesc.fHeight)); |
robertphillips | c9a3706 | 2015-09-01 08:34:28 -0700 | [diff] [blame] | 263 | SkAutoTUnref<GrDrawContext> drawContext(ctx->drawContext()); |
| 264 | if (!drawContext) { |
| 265 | return nullptr; |
| 266 | } |
| 267 | |
robertphillips | 2334fb6 | 2015-06-17 05:43:33 -0700 | [diff] [blame] | 268 | drawContext->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, SkMatrix::I(), rect); |
bsalomon | 993a421 | 2015-05-29 11:37:25 -0700 | [diff] [blame] | 269 | ctx->flushSurfaceWrites(dst); |
halcanary | 385fe4d | 2015-08-26 13:07:48 -0700 | [diff] [blame] | 270 | return new SkImage_Gpu(dstDesc.fWidth, dstDesc.fHeight, kNeedNewImageUniqueID, |
reed | 7b6945b | 2015-09-24 00:50:58 -0700 | [diff] [blame] | 271 | kOpaque_SkAlphaType, dst, budgeted); |
bsalomon | 993a421 | 2015-05-29 11:37:25 -0700 | [diff] [blame] | 272 | } |
reed | 5617900 | 2015-07-07 06:11:19 -0700 | [diff] [blame] | 273 | |
| 274 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
| 275 | |
| 276 | GrTexture* GrDeepCopyTexture(GrTexture* src, bool budgeted) { |
| 277 | GrContext* ctx = src->getContext(); |
| 278 | |
| 279 | GrSurfaceDesc desc = src->desc(); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 280 | GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullptr, 0); |
reed | 5617900 | 2015-07-07 06:11:19 -0700 | [diff] [blame] | 281 | if (!dst) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 282 | return nullptr; |
reed | 5617900 | 2015-07-07 06:11:19 -0700 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); |
| 286 | const SkIPoint dstP = SkIPoint::Make(0, 0); |
| 287 | ctx->copySurface(dst, src, srcR, dstP, GrContext::kFlushWrites_PixelOp); |
| 288 | return dst; |
| 289 | } |
| 290 | |