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

Unified Diff: ui/compositor/test/in_process_context_provider.cc

Issue 2278283003: Refactor client visibility handling (Closed)
Patch Set: fix compositor_unittests Created 4 years, 4 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
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 1e6bc30150e09a43d7ea0d77b66676319def858d..ba3dde4fb1f03a36b074770ea8189b1daf695032 100644
--- a/ui/compositor/test/in_process_context_provider.cc
+++ b/ui/compositor/test/in_process_context_provider.cc
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
+#include "cc/output/context_cache_controller.h"
#include "cc/output/managed_memory_policy.h"
#include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
@@ -93,6 +94,9 @@ bool InProcessContextProvider::BindToCurrentThread() {
if (!context_)
return false;
+
+ cache_controller_.reset(
+ new cc::ContextCacheController(context_->GetImplementation()));
}
std::string unique_context_name =
@@ -131,10 +135,16 @@ class GrContext* InProcessContextProvider::GrContext() {
return gr_context_->get();
gr_context_.reset(new skia_bindings::GrContextForGLES2Interface(ContextGL()));
+ cache_controller_->SetGrContext(gr_context_->get());
return gr_context_->get();
}
+cc::ContextCacheController* InProcessContextProvider::CacheController() {
+ DCHECK(context_thread_checker_.CalledOnValidThread());
+ return cache_controller_.get();
+}
+
void InProcessContextProvider::InvalidateGrContext(uint32_t state) {
DCHECK(context_thread_checker_.CalledOnValidThread());
@@ -146,13 +156,6 @@ base::Lock* InProcessContextProvider::GetLock() {
return &context_lock_;
}
-void InProcessContextProvider::DeleteCachedResources() {
- DCHECK(context_thread_checker_.CalledOnValidThread());
-
- if (gr_context_)
- gr_context_->FreeGpuResources();
-}
-
void InProcessContextProvider::SetLostContextCallback(
const LostContextCallback& lost_context_callback) {
// Pixel tests do not test lost context.

Powered by Google App Engine
This is Rietveld 408576698