OLD | NEW |
(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 |
OLD | NEW |