OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sky/shell/gpu/ganesh_surface.h" | 5 #include "sky/shell/gpu/ganesh_surface.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "third_party/skia/include/gpu/GrContext.h" | 8 #include "third_party/skia/include/gpu/GrContext.h" |
9 | 9 |
10 namespace sky { | 10 namespace sky { |
11 namespace shell { | 11 namespace shell { |
12 | 12 |
13 GaneshSurface::GaneshSurface(intptr_t window_fbo, | 13 GaneshSurface::GaneshSurface(intptr_t window_fbo, |
14 GaneshContext* context, | 14 GaneshContext* context, |
15 const gfx::Size& size) { | 15 const gfx::Size& size) { |
16 GrBackendRenderTargetDesc desc; | 16 GrBackendRenderTargetDesc desc; |
17 desc.fWidth = size.width(); | 17 desc.fWidth = size.width(); |
18 desc.fHeight = size.height(); | 18 desc.fHeight = size.height(); |
19 desc.fConfig = kSkia8888_GrPixelConfig; | 19 desc.fConfig = kSkia8888_GrPixelConfig; |
20 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; | 20 desc.fOrigin = kBottomLeft_GrSurfaceOrigin; |
21 desc.fRenderTargetHandle = window_fbo; | 21 desc.fRenderTargetHandle = window_fbo; |
22 | 22 |
23 auto target = skia::AdoptRef(context->gr()->wrapBackendRenderTarget(desc)); | 23 auto target = skia::AdoptRef( |
| 24 context->gr()->textureProvider()->wrapBackendRenderTarget(desc)); |
24 DCHECK(target); | 25 DCHECK(target); |
25 surface_ = skia::AdoptRef(SkSurface::NewRenderTargetDirect(target.get())); | 26 surface_ = skia::AdoptRef(SkSurface::NewRenderTargetDirect(target.get())); |
26 DCHECK(surface_); | 27 DCHECK(surface_); |
27 } | 28 } |
28 | 29 |
29 GaneshSurface::~GaneshSurface() { | 30 GaneshSurface::~GaneshSurface() { |
30 } | 31 } |
31 | 32 |
32 } // namespace shell | 33 } // namespace shell |
33 } // namespace sky | 34 } // namespace sky |
OLD | NEW |