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

Unified Diff: blimp/client/feature/compositor/blimp_context_provider.cc

Issue 1880823004: Move skia related files from content/common/gpu/client to gpu/skia_bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 8 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 | « blimp/client/feature/compositor/blimp_context_provider.h ('k') | cc/test/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/feature/compositor/blimp_context_provider.cc
diff --git a/blimp/client/feature/compositor/blimp_context_provider.cc b/blimp/client/feature/compositor/blimp_context_provider.cc
index bfb6e8fb8cc83a05f002bb40ceb2c8264f647fbd..a1ee746843246c752910750896c206cb9b21b992 100644
--- a/blimp/client/feature/compositor/blimp_context_provider.cc
+++ b/blimp/client/feature/compositor/blimp_context_provider.cc
@@ -10,7 +10,7 @@
#include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h"
-#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h"
+#include "gpu/skia_bindings/grcontext_for_gles2_interface.h"
#include "third_party/skia/include/gpu/GrContext.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
@@ -52,8 +52,6 @@ BlimpContextProvider::BlimpContextProvider(
BlimpContextProvider::~BlimpContextProvider() {
DCHECK(main_thread_checker_.CalledOnValidThread() ||
context_thread_checker_.CalledOnValidThread());
- if (gr_context_)
- gr_context_->releaseResourcesAndAbandonContext();
}
bool BlimpContextProvider::BindToCurrentThread() {
@@ -86,22 +84,18 @@ class GrContext* BlimpContextProvider::GrContext() {
DCHECK(context_thread_checker_.CalledOnValidThread());
if (gr_context_)
- return gr_context_.get();
+ return gr_context_->get();
- sk_sp<GrGLInterface> interface(
- skia_bindings::CreateGLES2InterfaceBindings(ContextGL()));
+ gr_context_.reset(new skia_bindings::GrContextForGLES2Interface(ContextGL()));
- gr_context_ = skia::AdoptRef(GrContext::Create(
- // GrContext takes ownership of |interface|.
- kOpenGL_GrBackend, reinterpret_cast<GrBackendContext>(interface.get())));
- return gr_context_.get();
+ return gr_context_->get();
}
void BlimpContextProvider::InvalidateGrContext(uint32_t state) {
DCHECK(context_thread_checker_.CalledOnValidThread());
if (gr_context_)
- gr_context_->resetContext(state);
+ gr_context_->ResetContext(state);
}
void BlimpContextProvider::SetupLock() {
@@ -116,7 +110,7 @@ void BlimpContextProvider::DeleteCachedResources() {
DCHECK(context_thread_checker_.CalledOnValidThread());
if (gr_context_)
- gr_context_->freeGpuResources();
+ gr_context_->FreeGpuResources();
}
void BlimpContextProvider::SetLostContextCallback(
@@ -130,7 +124,7 @@ void BlimpContextProvider::OnLostContext() {
if (!lost_context_callback_.is_null())
lost_context_callback_.Run();
if (gr_context_)
- gr_context_->abandonContext();
+ gr_context_->OnLostContext();
}
} // namespace client
« no previous file with comments | « blimp/client/feature/compositor/blimp_context_provider.h ('k') | cc/test/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698