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

Unified Diff: cc/output/delegating_renderer.cc

Issue 20185002: ContextProvider in OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: contextprovider: don't access Context3d() in OutputSurface contructors, it's not bound yet Created 7 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
« no previous file with comments | « cc/output/context_provider.h ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/delegating_renderer.cc
diff --git a/cc/output/delegating_renderer.cc b/cc/output/delegating_renderer.cc
index bd1c5d1174de77e540dd66fcaae5cb2f7ac63504..be8ab031e9771f25f5af1def4f38b1dc6591d04f 100644
--- a/cc/output/delegating_renderer.cc
+++ b/cc/output/delegating_renderer.cc
@@ -58,13 +58,14 @@ bool DelegatingRenderer::Initialize() {
capabilities_.allow_partial_texture_updates = false;
capabilities_.using_offscreen_context3d = false;
- WebGraphicsContext3D* context3d = resource_provider_->GraphicsContext3D();
-
- if (!context3d) {
- // Software compositing.
+ if (!output_surface_->context_provider()) {
+ // TODO(danakj): Make software compositing work.
return true;
}
+ WebGraphicsContext3D* context3d =
+ output_surface_->context_provider()->Context3d();
+
if (!context3d->makeContextCurrent())
return false;
@@ -171,10 +172,11 @@ void DelegatingRenderer::ReceiveSwapBuffersAck(
}
bool DelegatingRenderer::IsContextLost() {
- WebGraphicsContext3D* context3d = resource_provider_->GraphicsContext3D();
- if (!context3d)
+ ContextProvider* context_provider = output_surface_->context_provider();
+ if (!context_provider)
return false;
- return context3d->getGraphicsResetStatusARB() != GL_NO_ERROR;
+ return context_provider->Context3d()->getGraphicsResetStatusARB() !=
+ GL_NO_ERROR;
}
void DelegatingRenderer::SetVisible(bool visible) {
@@ -182,27 +184,27 @@ void DelegatingRenderer::SetVisible(bool visible) {
return;
visible_ = visible;
- WebGraphicsContext3D* context = resource_provider_->GraphicsContext3D();
+ ContextProvider* context_provider = output_surface_->context_provider();
if (!visible_) {
TRACE_EVENT0("cc", "DelegatingRenderer::SetVisible dropping resources");
resource_provider_->ReleaseCachedData();
- if (context)
- context->flush();
+ if (context_provider)
+ context_provider->Context3d()->flush();
}
if (capabilities_.using_set_visibility) {
// We loop visibility to the GPU process, since that's what manages memory.
// That will allow it to feed us with memory allocations that we can act
// upon.
- DCHECK(context);
- context->setVisibilityCHROMIUM(visible);
+ DCHECK(context_provider);
+ context_provider->Context3d()->setVisibilityCHROMIUM(visible);
}
}
void DelegatingRenderer::SendManagedMemoryStats(size_t bytes_visible,
size_t bytes_visible_and_nearby,
size_t bytes_allocated) {
- WebGraphicsContext3D* context = resource_provider_->GraphicsContext3D();
- if (!context) {
+ ContextProvider* context_provider = output_surface_->context_provider();
+ if (!context_provider) {
// TODO(piman): software path.
NOTIMPLEMENTED();
return;
@@ -212,7 +214,7 @@ void DelegatingRenderer::SendManagedMemoryStats(size_t bytes_visible,
stats.bytesVisibleAndNearby = bytes_visible_and_nearby;
stats.bytesAllocated = bytes_allocated;
stats.backbufferRequested = false;
- context->sendManagedMemoryStatsCHROMIUM(&stats);
+ context_provider->Context3d()->sendManagedMemoryStatsCHROMIUM(&stats);
}
void DelegatingRenderer::SetDiscardBackBufferWhenNotVisible(bool discard) {
« no previous file with comments | « cc/output/context_provider.h ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698