blob: 39d64acf1afc604e10c453e3c721fbf1458dacfd [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/vr/gl_bindings.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/gpu/GrContext.h"
class SkSurface;
namespace gfx {
class Size;
} // namespace gfx
namespace vr {
// Provides a Skia surface to draw textures of UI elements into.
class SkiaSurfaceProvider {
virtual ~SkiaSurfaceProvider() = default;
// Creates a surface with the specified size.
virtual sk_sp<SkSurface> MakeSurface(const gfx::Size& size) = 0;
// Applies all drawing commands and returns the ID of the texture containing
// the rendered image. If possible, it uses the texture passed
// by |reuse_texture_id| to draw into.
virtual GLuint FlushSurface(SkSurface* surface, GLuint reuse_texture_id) = 0;
} // namespace vr