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

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

Issue 891143002: Teach SkyShell how to draw with Ganesh (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Moar comments 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
« no previous file with comments | « sky/shell/gpu/ganesh_surface.h ('k') | sky/shell/gpu/rasterizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/gpu/ganesh_surface.cc
diff --git a/sky/shell/gpu/ganesh_surface.cc b/sky/shell/gpu/ganesh_surface.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fb15738d374ef0963d23d3b9d43c94f518b7e8b7
--- /dev/null
+++ b/sky/shell/gpu/ganesh_surface.cc
@@ -0,0 +1,30 @@
+// 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.
+
+#include "sky/shell/gpu/ganesh_surface.h"
+
+#include "base/logging.h"
+#include "third_party/skia/include/gpu/GrContext.h"
+
+namespace sky {
+namespace shell {
+
+GaneshSurface::GaneshSurface(GaneshContext* context, const gfx::Size& size) {
+ GrBackendRenderTargetDesc desc;
+ desc.fWidth = size.width();
+ desc.fHeight = size.height();
+ desc.fConfig = kSkia8888_GrPixelConfig;
+ desc.fOrigin = kTopLeft_GrSurfaceOrigin;
+
+ auto target = skia::AdoptRef(context->gr()->wrapBackendRenderTarget(desc));
+ DCHECK(target);
+ surface_ = skia::AdoptRef(SkSurface::NewRenderTargetDirect(target.get()));
+ DCHECK(surface_);
+}
+
+GaneshSurface::~GaneshSurface() {
+}
+
+} // namespace shell
+} // namespace sky
« no previous file with comments | « sky/shell/gpu/ganesh_surface.h ('k') | sky/shell/gpu/rasterizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698