flutter_flutter/shell/gpu/ganesh_context.h
Adam Barth 3b32bd6a72 Teach SkyShell how to draw with Ganesh
This CL adds support to SkyShell for drawing with Ganesh. Currently, we don't
actually create any SkPictures to draw, but that will come in a later CL.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/891143002
2015-02-01 00:39:36 -08:00

38 lines
1.0 KiB
C++

// Copyright 2015 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.
#ifndef SKY_SHELL_GPU_GANESH_CONTEXT_H_
#define SKY_SHELL_GPU_GANESH_CONTEXT_H_
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "skia/ext/refptr.h"
#include "third_party/skia/include/gpu/GrContext.h"
#include "ui/gl/gl_context.h"
namespace sky {
namespace shell {
// GaneshContext holds the top-level context object for Ganesh (known as
// GrContext). We construct the GrContext using the OpenGL interface provided by
// gfx::GLContext.
class GaneshContext {
public:
explicit GaneshContext(scoped_refptr<gfx::GLContext> gl_context);
~GaneshContext();
GrContext* gr() const { return gr_context_.get(); }
private:
scoped_refptr<gfx::GLContext> gl_context_;
skia::RefPtr<GrContext> gr_context_;
DISALLOW_COPY_AND_ASSIGN(GaneshContext);
};
} // namespace shell
} // namespace sky
#endif // SKY_SHELL_GPU_GANESH_CONTEXT_H_