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

Unified Diff: cc/test/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: cc/test/test_in_process_context_provider.cc
diff --git a/cc/test/test_in_process_context_provider.cc b/cc/test/test_in_process_context_provider.cc
index 2a129829215163c56802b596db1909639d6f02c1..9c024db4edf710450802ac7279417648ee2a6410 100644
--- a/cc/test/test_in_process_context_provider.cc
+++ b/cc/test/test_in_process_context_provider.cc
@@ -9,6 +9,7 @@
#include "base/lazy_instance.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "cc/output/context_cache_controller.h"
#include "cc/resources/platform_color.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gl_in_process_context.h"
@@ -59,7 +60,9 @@ TestInProcessContextProvider::TestInProcessContextProvider(
: context_(CreateTestInProcessContext(
&gpu_memory_buffer_manager_,
&image_factory_,
- (shared_context ? shared_context->context_.get() : nullptr))) {}
+ (shared_context ? shared_context->context_.get() : nullptr))),
+ cache_controller_(
+ new ContextCacheController(context_->GetImplementation())) {}
TestInProcessContextProvider::~TestInProcessContextProvider() {
}
@@ -81,9 +84,14 @@ class GrContext* TestInProcessContextProvider::GrContext() {
return gr_context_->get();
gr_context_.reset(new skia_bindings::GrContextForGLES2Interface(ContextGL()));
+ cache_controller_->SetGrContext(gr_context_->get());
return gr_context_->get();
}
+ContextCacheController* TestInProcessContextProvider::CacheController() {
+ return cache_controller_.get();
+}
+
void TestInProcessContextProvider::InvalidateGrContext(uint32_t state) {
if (gr_context_)
gr_context_->ResetContext(state);
@@ -109,11 +117,6 @@ gpu::Capabilities TestInProcessContextProvider::ContextCapabilities() {
return capabilities;
}
-void TestInProcessContextProvider::DeleteCachedResources() {
- if (gr_context_)
- gr_context_->FreeGpuResources();
-}
-
void TestInProcessContextProvider::SetLostContextCallback(
const LostContextCallback& lost_context_callback) {}

Powered by Google App Engine
This is Rietveld 408576698