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() { |