| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 | 10 |
| 11 namespace content { | |
| 12 class GLHelper; | |
| 13 } | |
| 14 | |
| 15 namespace gfx { | 11 namespace gfx { |
| 16 class Size; | 12 class Size; |
| 17 } | 13 } |
| 18 | 14 |
| 19 namespace ui { | 15 namespace ui { |
| 20 class ContextFactory; | 16 class ContextFactory; |
| 21 class Texture; | 17 class Texture; |
| 22 } | 18 } |
| 23 | 19 |
| 24 namespace WebKit { | 20 namespace WebKit { |
| 25 class WebGraphicsContext3D; | 21 class WebGraphicsContext3D; |
| 26 } | 22 } |
| 27 | 23 |
| 24 namespace content { |
| 25 class GLHelper; |
| 26 |
| 28 // This class provides a way to get notified when surface handles get lost. | 27 // This class provides a way to get notified when surface handles get lost. |
| 29 class ImageTransportFactoryObserver { | 28 class ImageTransportFactoryObserver { |
| 30 public: | 29 public: |
| 31 virtual ~ImageTransportFactoryObserver() {} | 30 virtual ~ImageTransportFactoryObserver() {} |
| 32 | 31 |
| 33 // Notifies that the surface handles generated by ImageTransportFactory were | 32 // Notifies that the surface handles generated by ImageTransportFactory were |
| 34 // lost. | 33 // lost. |
| 35 // When this is called, the old resources (e.g. shared context, GL helper) | 34 // When this is called, the old resources (e.g. shared context, GL helper) |
| 36 // still exist, but are about to be destroyed. Getting a reference to those | 35 // still exist, but are about to be destroyed. Getting a reference to those |
| 37 // resources from the ImageTransportFactory (e.g. through GetGLHelper) will | 36 // resources from the ImageTransportFactory (e.g. through GetGLHelper) will |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // Variant of CreateTransportClient() that deletes the texture on the GPU when | 78 // Variant of CreateTransportClient() that deletes the texture on the GPU when |
| 80 // the returned value is deleted. | 79 // the returned value is deleted. |
| 81 virtual scoped_refptr<ui::Texture> CreateOwnedTexture( | 80 virtual scoped_refptr<ui::Texture> CreateOwnedTexture( |
| 82 const gfx::Size& size, | 81 const gfx::Size& size, |
| 83 float device_scale_factor, | 82 float device_scale_factor, |
| 84 unsigned int texture_id) = 0; | 83 unsigned int texture_id) = 0; |
| 85 | 84 |
| 86 // Gets a GLHelper instance, associated with the shared context. This | 85 // Gets a GLHelper instance, associated with the shared context. This |
| 87 // GLHelper will get destroyed whenever the shared context is lost | 86 // GLHelper will get destroyed whenever the shared context is lost |
| 88 // (ImageTransportFactoryObserver::OnLostResources is called). | 87 // (ImageTransportFactoryObserver::OnLostResources is called). |
| 89 virtual content::GLHelper* GetGLHelper() = 0; | 88 virtual GLHelper* GetGLHelper() = 0; |
| 90 | 89 |
| 91 // Inserts a SyncPoint into the shared context. | 90 // Inserts a SyncPoint into the shared context. |
| 92 virtual uint32 InsertSyncPoint() = 0; | 91 virtual uint32 InsertSyncPoint() = 0; |
| 93 | 92 |
| 94 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; | 93 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; |
| 95 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; | 94 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; |
| 96 }; | 95 }; |
| 97 | 96 |
| 97 } // namespace content |
| 98 |
| 98 #endif // CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_H_ | 99 #endif // CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_H_ |
| OLD | NEW |