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

Unified Diff: cc/test/test_context_provider.cc

Issue 110883015: Add preliminary support for hw-accelerated tile rasterization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added unit tests Created 6 years, 12 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_context_provider.cc
diff --git a/cc/test/test_context_provider.cc b/cc/test/test_context_provider.cc
index 626b587b3145261faa06cd9f653c7edd449e7dcb..bfa7433fcd6a7338a28f4deebf71ca5d2e2d2fae 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 {
@@ -115,8 +117,12 @@ 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_) {
+ gr_context_ = skia::AdoptRef(GrContext::Create(
+ kOpenGL_GrBackend,
+ reinterpret_cast<GrBackendContext>(GrGLCreateNullInterface())));
+ }
+ return gr_context_.get();
}
void TestContextProvider::MakeGrContextCurrent() {}

Powered by Google App Engine
This is Rietveld 408576698