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

Unified Diff: content/browser/android/in_process/synchronous_compositor_output_surface.cc

Issue 15860003: AW hardware draw mega patch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: r205552 Created 7 years, 6 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 | « content/browser/android/in_process/synchronous_compositor_output_surface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/in_process/synchronous_compositor_output_surface.cc
diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.cc b/content/browser/android/in_process/synchronous_compositor_output_surface.cc
index 7613168adfd70901b16776a56a58c042b8d6bdaf..4ca89a90ec5d8aa77b096c720d40633576366f7c 100644
--- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc
+++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc
@@ -17,6 +17,7 @@
#include "content/public/browser/android/synchronous_compositor_client.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
+#include "content/renderer/android/synchronous_compositor_factory.h"
#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkDevice.h"
@@ -92,6 +93,12 @@ SynchronousCompositorOutputSurface::SynchronousCompositorOutputSurface(
capabilities_.deferred_gl_initialization = true;
// Cannot call out to GetDelegate() here as the output surface is not
// constructed on the correct thread.
+
+ SynchronousCompositorFactory* factory =
+ SynchronousCompositorFactory::GetInstance();
+ DCHECK(factory);
+ context_provider_for_compositor_thread_ =
+ factory->GetOffscreenContextProviderForCompositorThread();
}
SynchronousCompositorOutputSurface::~SynchronousCompositorOutputSurface() {
@@ -153,9 +160,11 @@ bool SynchronousCompositorOutputSurface::InitializeHwDraw() {
DCHECK(client_);
DCHECK(!context3d_);
- // TODO(boliu): Get a context provider in constructor and pass here.
+ scoped_refptr<cc::ContextProvider> provider;
+ provider.swap(context_provider_for_compositor_thread_);
+
return InitializeAndSetContext3D(CreateWebGraphicsContext3D().Pass(),
- scoped_refptr<cc::ContextProvider>());
+ provider);
}
bool SynchronousCompositorOutputSurface::DemandDrawHw(
« no previous file with comments | « content/browser/android/in_process/synchronous_compositor_output_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698