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

Unified Diff: cc/resource_update_controller.cc

Issue 12212007: cc: Route offscreen context creation for compositor to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/resource_update_controller.cc
diff --git a/cc/resource_update_controller.cc b/cc/resource_update_controller.cc
index 1177d5372fcaa69b0d8012bf20243bdc572c23e9..b65c11772a6912ebe94bafbfd13a9b8588f605ad 100644
--- a/cc/resource_update_controller.cc
+++ b/cc/resource_update_controller.cc
@@ -13,12 +13,10 @@
#include "cc/thread.h"
#include "skia/ext/refptr.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3D.h"
-#include "third_party/WebKit/Source/Platform/chromium/public/WebSharedGraphicsContext3D.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/skia/include/gpu/SkGpuDevice.h"
using WebKit::WebGraphicsContext3D;
-using WebKit::WebSharedGraphicsContext3D;
namespace {
@@ -124,19 +122,20 @@ void ResourceUpdateController::updateTexture(ResourceUpdate update)
gfx::Rect sourceRect = update.source_rect;
gfx::Vector2d destOffset = update.dest_offset;
+ WebGraphicsContext3D* paintContext = m_resourceProvider->offscreenGraphicsContext3d();
+ if (!paintContext)
+ return;
+
+ GrContext* paintGrContext = m_resourceProvider->offscreenGrContext();
+ if (!paintGrContext)
+ return;
+
texture->acquireBackingTexture(m_resourceProvider);
DCHECK(texture->haveBackingTexture());
DCHECK(m_resourceProvider->resourceType(texture->resourceId()) ==
ResourceProvider::GLTexture);
- WebGraphicsContext3D* paintContext = m_hasImplThread ?
- WebSharedGraphicsContext3D::compositorThreadContext() :
- WebSharedGraphicsContext3D::mainThreadContext();
- GrContext* paintGrContext = m_hasImplThread ?
- WebSharedGraphicsContext3D::compositorThreadGrContext() :
- WebSharedGraphicsContext3D::mainThreadGrContext();
-
// Flush the context in which the backing texture is created so that it
// is available in other shared contexts. It is important to do here
// because the backing texture is created in one context while it is

Powered by Google App Engine
This is Rietveld 408576698