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

Side by Side 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, 10 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "sky/shell/gpu/ganesh_surface.h"
6
7 #include "base/logging.h"
8 #include "third_party/skia/include/gpu/GrContext.h"
9
10 namespace sky {
11 namespace shell {
12
13 GaneshSurface::GaneshSurface(GaneshContext* context, const gfx::Size& size) {
14 GrBackendRenderTargetDesc desc;
15 desc.fWidth = size.width();
16 desc.fHeight = size.height();
17 desc.fConfig = kSkia8888_GrPixelConfig;
18 desc.fOrigin = kTopLeft_GrSurfaceOrigin;
19
20 auto target = skia::AdoptRef(context->gr()->wrapBackendRenderTarget(desc));
21 DCHECK(target);
22 surface_ = skia::AdoptRef(SkSurface::NewRenderTargetDirect(target.get()));
23 DCHECK(surface_);
24 }
25
26 GaneshSurface::~GaneshSurface() {
27 }
28
29 } // namespace shell
30 } // namespace sky
OLDNEW
« 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