| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrContext.h" | 8 #include "GrContext.h" |
| 9 #include "GrRenderTargetContext.h" | 9 #include "GrRenderTargetContext.h" |
| 10 #include "GrTextureProxy.h" |
| 10 #include "GrYUVProvider.h" | 11 #include "GrYUVProvider.h" |
| 11 #include "effects/GrGammaEffect.h" | 12 #include "effects/GrGammaEffect.h" |
| 12 #include "effects/GrYUVEffect.h" | 13 #include "effects/GrYUVEffect.h" |
| 13 | 14 |
| 14 #include "SkCachedData.h" | 15 #include "SkCachedData.h" |
| 15 #include "SkRefCnt.h" | 16 #include "SkRefCnt.h" |
| 16 #include "SkResourceCache.h" | 17 #include "SkResourceCache.h" |
| 17 #include "SkYUVPlanesCache.h" | 18 #include "SkYUVPlanesCache.h" |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 paint.addColorFragmentProcessor(GrGammaEffect::Make(2.2f)); | 143 paint.addColorFragmentProcessor(GrGammaEffect::Make(2.2f)); |
| 143 } | 144 } |
| 144 } | 145 } |
| 145 | 146 |
| 146 paint.setPorterDuffXPFactory(SkBlendMode::kSrc); | 147 paint.setPorterDuffXPFactory(SkBlendMode::kSrc); |
| 147 const SkRect r = SkRect::MakeIWH(yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY]
.fWidth, | 148 const SkRect r = SkRect::MakeIWH(yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY]
.fWidth, |
| 148 yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY].fHeight); | 149 yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY].fHeight); |
| 149 | 150 |
| 150 renderTargetContext->drawRect(GrNoClip(), paint, SkMatrix::I(), r); | 151 renderTargetContext->drawRect(GrNoClip(), paint, SkMatrix::I(), r); |
| 151 | 152 |
| 152 return renderTargetContext->asTexture(); | 153 sk_sp<GrTextureProxy> tp(renderTargetContext->asDeferredTexture()); |
| 154 return sk_ref_sp(tp->instantiate(ctx->textureProvider())); |
| 153 } | 155 } |
| OLD | NEW |