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

Unified Diff: content/browser/renderer_host/image_transport_factory.cc

Issue 10824270: Revert 151153 - Partial revert of 146621 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
Index: content/browser/renderer_host/image_transport_factory.cc
===================================================================
--- content/browser/renderer_host/image_transport_factory.cc (revision 151158)
+++ content/browser/renderer_host/image_transport_factory.cc (working copy)
@@ -57,7 +57,8 @@
virtual scoped_refptr<ui::Texture> CreateTransportClient(
const gfx::Size& size,
- uint64 transport_handle) OVERRIDE {
+ uint64 transport_handle,
+ ui::Compositor* compositor) OVERRIDE {
return NULL;
}
@@ -85,16 +86,27 @@
class ImageTransportClientTexture : public ui::Texture {
public:
ImageTransportClientTexture(
+ WebKit::WebGraphicsContext3D* host_context,
const gfx::Size& size,
uint64 surface_id)
- : ui::Texture(true, size) {
+ : ui::Texture(true, size),
+ host_context_(host_context) {
set_texture_id(surface_id);
}
+ virtual WebKit::WebGraphicsContext3D* HostContext3D() {
+ return host_context_;
+ }
+
protected:
virtual ~ImageTransportClientTexture() {}
private:
+ // A raw pointer. This |ImageTransportClientTexture| will be destroyed
+ // before the |host_context_| via
+ // |ImageTransportFactoryObserver::OnLostContext()| handlers.
+ WebKit::WebGraphicsContext3D* host_context_;
+
DISALLOW_COPY_AND_ASSIGN(ImageTransportClientTexture);
};
@@ -209,9 +221,13 @@
virtual scoped_refptr<ui::Texture> CreateTransportClient(
const gfx::Size& size,
- uint64 transport_handle) {
+ uint64 transport_handle,
+ ui::Compositor* compositor) {
+ PerCompositorData* data = per_compositor_data_[compositor];
+ DCHECK(data);
scoped_refptr<ImageTransportClientTexture> image(
- new ImageTransportClientTexture(size, transport_handle));
+ new ImageTransportClientTexture(data->shared_context.get(),
+ size, transport_handle));
return image;
}
« no previous file with comments | « content/browser/renderer_host/image_transport_factory.h ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698