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

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: rebase Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/skia/ganesh_framebuffer_surface.h ('k') | mojo/skia/ganesh_image_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c8ad676b8dff7c01017418844895d88979e9d29e 100644
--- a/mojo/skia/ganesh_framebuffer_surface.cc
+++ b/mojo/skia/ganesh_framebuffer_surface.cc
@@ -2,17 +2,17 @@
// 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"
namespace mojo {
+namespace skia {
-GaneshFramebufferSurface::GaneshFramebufferSurface(GaneshContext* context) {
- DCHECK(context);
- GaneshContext::Scope scope(context);
-
+GaneshFramebufferSurface::GaneshFramebufferSurface(
+ const GaneshContext::Scope& scope) {
GLint samples = 0;
glGetIntegerv(GL_SAMPLES, &samples);
GLint stencil_bits = 0;
@@ -32,14 +32,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(scope.gr_context(), desc, nullptr));
DCHECK(surface_);
}
GaneshFramebufferSurface::~GaneshFramebufferSurface() {}
+} // namespace skia
} // namespace mojo
« no previous file with comments | « mojo/skia/ganesh_framebuffer_surface.h ('k') | mojo/skia/ganesh_image_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698