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

Unified Diff: cc/layers/io_surface_layer_impl.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/layers/delegated_renderer_layer_impl_unittest.cc ('k') | cc/layers/nine_patch_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/io_surface_layer_impl.cc
diff --git a/cc/layers/io_surface_layer_impl.cc b/cc/layers/io_surface_layer_impl.cc
index f8577a3776579d1d8541a7bea4a8782f20160f1d..e8c627be08b7809ab78c118edf23aa02c5e602bd 100644
--- a/cc/layers/io_surface_layer_impl.cc
+++ b/cc/layers/io_surface_layer_impl.cc
@@ -39,11 +39,11 @@ void IOSurfaceLayerImpl::DestroyTexture() {
}
if (io_surface_texture_id_) {
- OutputSurface* output_surface = layer_tree_impl()->output_surface();
+ ContextProvider* context_provider =
+ layer_tree_impl()->output_surface()->context_provider().get();
// TODO(skaslev): Implement this path for software compositing.
- WebKit::WebGraphicsContext3D* context3d = output_surface->context3d();
- if (context3d)
- context3d->deleteTexture(io_surface_texture_id_);
+ if (context_provider)
+ context_provider->Context3d()->deleteTexture(io_surface_texture_id_);
io_surface_texture_id_ = 0;
}
}
@@ -67,13 +67,15 @@ bool IOSurfaceLayerImpl::WillDraw(DrawMode draw_mode,
return false;
if (io_surface_changed_) {
- WebKit::WebGraphicsContext3D* context3d =
- resource_provider->GraphicsContext3D();
- if (!context3d) {
+ ContextProvider* context_provider =
+ layer_tree_impl()->output_surface()->context_provider().get();
+ if (!context_provider) {
// TODO(skaslev): Implement this path for software compositing.
return false;
}
+ WebKit::WebGraphicsContext3D* context3d = context_provider->Context3d();
+
// TODO(ernstm): Do this in a way that we can track memory usage.
if (!io_surface_texture_id_) {
io_surface_texture_id_ = context3d->createTexture();
« no previous file with comments | « cc/layers/delegated_renderer_layer_impl_unittest.cc ('k') | cc/layers/nine_patch_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698