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

Unified Diff: mojo/skia/ganesh_framebuffer_surface.cc

Issue 1534033002: Improve Ganesh helpers. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-8
Patch Set: fix includes Created 5 years 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
Index: mojo/skia/ganesh_framebuffer_surface.cc
diff --git a/mojo/skia/ganesh_framebuffer_surface.cc b/mojo/skia/ganesh_framebuffer_surface.cc
index f56d11e2e58163b0fe2fe96dfcbc27c00ac8517f..990785679815bbfa70200b137112ae125ec77a8e 100644
--- a/mojo/skia/ganesh_framebuffer_surface.cc
+++ b/mojo/skia/ganesh_framebuffer_surface.cc
@@ -2,12 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "mojo/skia/ganesh_framebuffer_surface.h"
+
#include <GLES2/gl2.h>
#include "base/logging.h"
-#include "mojo/skia/ganesh_framebuffer_surface.h"
+#include "mojo/skia/ganesh_context.h"
namespace mojo {
+namespace skia {
GaneshFramebufferSurface::GaneshFramebufferSurface(GaneshContext* context) {
DCHECK(context);
@@ -32,14 +35,13 @@ GaneshFramebufferSurface::GaneshFramebufferSurface(GaneshContext* context) {
desc.fSampleCnt = samples;
desc.fStencilBits = stencil_bits;
desc.fRenderTargetHandle = framebuffer_binding;
- GrRenderTarget* render_target =
- context->gr()->textureProvider()->wrapBackendRenderTarget(desc);
- DCHECK(render_target);
- surface_ = skia::AdoptRef(SkSurface::NewRenderTargetDirect(render_target));
+ surface_ = ::skia::AdoptRef(SkSurface::NewFromBackendRenderTarget(
+ context->gr_context(), desc, nullptr));
DCHECK(surface_);
}
GaneshFramebufferSurface::~GaneshFramebufferSurface() {}
+} // namespace skia
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698