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

Unified Diff: cc/test/test_context_provider.cc

Issue 812543002: Update from https://crrev.com/308331 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « cc/test/test_context_provider.h ('k') | cc/test/test_shared_bitmap_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/test_context_provider.cc
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc
index e7697f17d25ea69618c976a058cb81d1b1a350f4..2a2b6f6e67e766056e95c2bc094154069b538b2f 100644
--- a/cc/test/test_context_provider.cc
+++ b/cc/test/test_context_provider.cc
@@ -12,6 +12,8 @@
#include "base/logging.h"
#include "cc/test/test_gles2_interface.h"
#include "cc/test/test_web_graphics_context_3d.h"
+#include "third_party/skia/include/gpu/GrContext.h"
+#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
namespace cc {
@@ -90,8 +92,14 @@ class GrContext* TestContextProvider::GrContext() {
DCHECK(bound_);
DCHECK(context_thread_checker_.CalledOnValidThread());
- // TODO(danakj): Make a test GrContext that works with a test Context3d.
- return NULL;
+ if (gr_context_)
+ return gr_context_.get();
+
+ auto null_interface = skia::AdoptRef(GrGLCreateNullInterface());
+ gr_context_ = skia::AdoptRef(GrContext::Create(
+ kOpenGL_GrBackend,
+ reinterpret_cast<GrBackendContext>(null_interface.get())));
+ return gr_context_.get();
}
bool TestContextProvider::IsContextLost() {
« no previous file with comments | « cc/test/test_context_provider.h ('k') | cc/test/test_shared_bitmap_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698