Fix VisualBench to hold onto a surface
BUG=skia: Review URL: https://codereview.chromium.org/1236723003
This commit is contained in:
parent
108b5b2c23
commit
d4fa90feea
@ -74,8 +74,13 @@ void VisualBench::setTitle() {
|
||||
}
|
||||
|
||||
SkSurface* VisualBench::createSurface() {
|
||||
SkSurfaceProps props(INHERITED::getSurfaceProps());
|
||||
return SkSurface::NewRenderTargetDirect(fRenderTarget, &props);
|
||||
if (!fSurface) {
|
||||
SkSurfaceProps props(INHERITED::getSurfaceProps());
|
||||
fSurface.reset(SkSurface::NewRenderTargetDirect(fRenderTarget, &props));
|
||||
}
|
||||
|
||||
// The caller will wrap the SkSurface in an SkAutoTUnref
|
||||
return SkRef(fSurface.get());
|
||||
}
|
||||
|
||||
bool VisualBench::setupBackend() {
|
||||
|
Loading…
Reference in New Issue
Block a user