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

Unified Diff: ui/compositor/test/in_process_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 | « ui/compositor/test/in_process_context_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/test/in_process_context_provider.cc
diff --git a/ui/compositor/test/in_process_context_provider.cc b/ui/compositor/test/in_process_context_provider.cc
index 1eac2df060acfd389cb0e3e59c09219417433a00..591eedc3bb5f570b072b5e84e119c2de376ef24a 100644
--- a/ui/compositor/test/in_process_context_provider.cc
+++ b/ui/compositor/test/in_process_context_provider.cc
@@ -14,7 +14,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"
@@ -75,8 +75,6 @@ InProcessContextProvider::InProcessContextProvider(
InProcessContextProvider::~InProcessContextProvider() {
DCHECK(main_thread_checker_.CalledOnValidThread() ||
context_thread_checker_.CalledOnValidThread());
- if (gr_context_)
- gr_context_->releaseResourcesAndAbandonContext();
}
bool InProcessContextProvider::BindToCurrentThread() {
@@ -134,21 +132,18 @@ class GrContext* InProcessContextProvider::GrContext() {
DCHECK(context_thread_checker_.CalledOnValidThread());
if (gr_context_)
- return gr_context_.get();
-
- sk_sp<GrGLInterface> interface(
- skia_bindings::CreateGLES2InterfaceBindings(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();
+
+ gr_context_.reset(new skia_bindings::GrContextForGLES2Interface(ContextGL()));
+
+ return gr_context_->get();
}
void InProcessContextProvider::InvalidateGrContext(uint32_t state) {
DCHECK(context_thread_checker_.CalledOnValidThread());
if (gr_context_)
- gr_context_.get()->resetContext(state);
+ gr_context_->ResetContext(state);
}
void InProcessContextProvider::SetupLock() {
@@ -161,11 +156,8 @@ base::Lock* InProcessContextProvider::GetLock() {
void InProcessContextProvider::DeleteCachedResources() {
DCHECK(context_thread_checker_.CalledOnValidThread());
- if (gr_context_) {
- TRACE_EVENT_INSTANT0("gpu", "GrContext::freeGpuResources",
- TRACE_EVENT_SCOPE_THREAD);
- gr_context_->freeGpuResources();
- }
+ if (gr_context_)
+ gr_context_->FreeGpuResources();
}
void InProcessContextProvider::SetLostContextCallback(
« no previous file with comments | « ui/compositor/test/in_process_context_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698