Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1384)

Unified Diff: sky/shell/gpu/ganesh_surface.h

Issue 891143002: Teach SkyShell how to draw with Ganesh (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: build fix Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/shell/gpu/ganesh_surface.h
diff --git a/sky/shell/gpu/ganesh_surface.h b/sky/shell/gpu/ganesh_surface.h
new file mode 100644
index 0000000000000000000000000000000000000000..1b552b21b1f46cdfeb30093f2c41a7b286ccf748
--- /dev/null
+++ b/sky/shell/gpu/ganesh_surface.h
@@ -0,0 +1,36 @@
+// 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_SURFACE_H_
+#define SKY_SHELL_GPU_GANESH_SURFACE_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "skia/ext/refptr.h"
+#include "sky/shell/gpu/ganesh_context.h"
+#include "third_party/skia/include/core/SkSurface.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace sky {
+namespace shell {
+
+class GaneshSurface {
+ public:
+ GaneshSurface(GaneshContext* context, const gfx::Size& size);
+ ~GaneshSurface();
+
+ SkCanvas* canvas() const { return surface_->getCanvas(); }
+ gfx::Size size() const {
+ return gfx::Size(surface_->width(), surface_->height());
+ }
+
+ private:
+ skia::RefPtr<SkSurface> surface_;
+
+ DISALLOW_COPY_AND_ASSIGN(GaneshSurface);
+};
+
+} // namespace shell
+} // namespace sky
+
+#endif // SKY_SHELL_GPU_GANESH_SURFACE_H_

Powered by Google App Engine
This is Rietveld 408576698