Chromium Code Reviews| Index: cc/resources/resource_provider.cc |
| diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc |
| index 54411aa1853e3ffbec18d1ce93cb664b444e2d0d..af2fc72f773a914355f3cf5b21c47b559d5067a1 100644 |
| --- a/cc/resources/resource_provider.cc |
| +++ b/cc/resources/resource_provider.cc |
| @@ -989,11 +989,18 @@ void ResourceProvider::ScopedWriteLockGr::InitSkSurface( |
| surface_props = |
| SkSurfaceProps(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
| } |
| - sk_surface_ = skia::AdoptRef( |
| - SkSurface::NewWrappedRenderTarget(gr_context, desc, &surface_props)); |
| + gr_surface_ = |
|
bsalomon
2016/02/09 14:55:56
Why this change? Is there something missing from t
Kimmo Kinnunen
2016/02/09 18:13:44
To get a GrSurface reference. Maybe I'm missing an
bsalomon
2016/02/09 18:22:12
Oh, of course.
|
| + skia::AdoptRef(gr_context->textureProvider()->wrapBackendTexture( |
| + desc, kBorrow_GrWrapOwnership)); |
| + if (gr_surface_) |
| + sk_surface_ = skia::AdoptRef(SkSurface::NewRenderTargetDirect( |
| + gr_surface_->asRenderTarget(), &surface_props)); |
| } |
| void ResourceProvider::ScopedWriteLockGr::ReleaseSkSurface() { |
| + DCHECK(gr_surface_); |
| + gr_surface_->prepareForExternalIO(); |
|
Kimmo Kinnunen
2016/02/09 18:13:44
For this call, we need GrSurface.
Kimmo Kinnunen
2016/02/09 18:17:27
Or are you hinting it'd be better just call sk_sur
bsalomon
2016/02/09 18:22:12
I think that'd be preferable. I had been thinking
|
| + gr_surface_.clear(); |
| sk_surface_.clear(); |
| } |