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

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: build fix 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
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 "third_party/skia/include/gpu/GrContext.h"
8
9 namespace sky {
10 namespace shell {
11
12 GaneshSurface::GaneshSurface(GaneshContext* context, const gfx::Size& size) {
13 GrBackendRenderTargetDesc desc;
14 desc.fWidth = size.width();
15 desc.fHeight = size.height();
16 desc.fConfig = kSkia8888_GrPixelConfig;
17 desc.fOrigin = kTopLeft_GrSurfaceOrigin;
18
19 auto target = skia::AdoptRef(context->gr()->wrapBackendRenderTarget(desc));
20 DCHECK(target);
21 surface_ = skia::AdoptRef(SkSurface::NewRenderTargetDirect(target.get()));
22 DCHECK(surface_);
23 }
24
25 GaneshSurface::~GaneshSurface() {
26 }
27
28 } // namespace shell
29 } // namespace sky
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698