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

Unified Diff: mojo/skia/ganesh_context.cc

Issue 1534813003: Use C bindings to Mojo GL entry points exclusively. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-6
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/BUILD.gn ('k') | mojo/skia/gl_bindings_skia.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/skia/ganesh_context.cc
diff --git a/mojo/skia/ganesh_context.cc b/mojo/skia/ganesh_context.cc
index d68776bffdd1d03bec9639571e6f177c2c0a2b9c..76b7c597332914472b8d6a52ecb903a2a0fb7e80 100644
--- a/mojo/skia/ganesh_context.cc
+++ b/mojo/skia/ganesh_context.cc
@@ -4,8 +4,8 @@
#include "mojo/skia/ganesh_context.h"
-#include "gpu/command_buffer/client/gles2_lib.h"
-#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h"
+#include "mojo/public/c/gpu/MGL/mgl.h"
+#include "mojo/skia/gl_bindings_skia.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
namespace mojo {
@@ -18,14 +18,6 @@ const int kMaxGaneshResourceCacheCount = 2048;
// The limit of the bytes allocated toward GPU resources in the GrContext's
// GPU cache.
const size_t kMaxGaneshResourceCacheBytes = 96 * 1024 * 1024;
-
-void EnsureInitialized() {
- static bool initialized;
- if (initialized)
- return;
- gles2::Initialize();
- initialized = true;
-}
}
GaneshContext::Scope::Scope(GaneshContext* context)
@@ -42,14 +34,12 @@ GaneshContext::Scope::~Scope() {
GaneshContext::GaneshContext(base::WeakPtr<GLContext> gl_context)
: gl_context_(gl_context) {
- EnsureInitialized();
-
DCHECK(gl_context_);
gl_context_->AddObserver(this);
Scope scope(this);
skia::RefPtr<GrGLInterface> interface =
- skia::AdoptRef(skia_bindings::CreateCommandBufferSkiaGLBinding());
+ skia::AdoptRef(skia_bindings::CreateMojoSkiaGLBinding());
DCHECK(interface);
context_ = skia::AdoptRef(GrContext::Create(
@@ -69,7 +59,7 @@ GaneshContext::~GaneshContext() {
}
bool GaneshContext::InScope() const {
- return gles2::GetGLContext() == gl_context_->gl();
+ return gl_context_->IsCurrent();
}
void GaneshContext::OnContextLost() {
« no previous file with comments | « mojo/skia/BUILD.gn ('k') | mojo/skia/gl_bindings_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698