OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ |
6 #define CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 static void Terminate(); | 62 static void Terminate(); |
63 | 63 |
64 // Gets the factory instance. | 64 // Gets the factory instance. |
65 static ImageTransportFactory* GetInstance(); | 65 static ImageTransportFactory* GetInstance(); |
66 | 66 |
67 // Gets the image transport factory as a context factory for the compositor. | 67 // Gets the image transport factory as a context factory for the compositor. |
68 virtual ui::ContextFactory* AsContextFactory() = 0; | 68 virtual ui::ContextFactory* AsContextFactory() = 0; |
69 | 69 |
70 virtual gfx::GLSurfaceHandle GetSharedSurfaceHandle() = 0; | 70 virtual gfx::GLSurfaceHandle GetSharedSurfaceHandle() = 0; |
71 | 71 |
72 // Creates a transport texture for a given scale factor. | 72 // Creates a ui::Texture that deletes the GL texture when deleted. |
73 virtual scoped_refptr<ui::Texture> CreateTransportClient( | |
74 float device_scale_factor) = 0; | |
75 | |
76 // Variant of CreateTransportClient() that deletes the texture on the GPU when | |
77 // the returned value is deleted. | |
78 virtual scoped_refptr<ui::Texture> CreateOwnedTexture( | 73 virtual scoped_refptr<ui::Texture> CreateOwnedTexture( |
79 const gfx::Size& size, | 74 const gfx::Size& size, |
80 float device_scale_factor, | 75 float device_scale_factor, |
81 unsigned int texture_id) = 0; | 76 unsigned int texture_id) = 0; |
82 | 77 |
83 // Gets a GLHelper instance, associated with the shared context. This | 78 // Gets a GLHelper instance, associated with the shared context. This |
84 // GLHelper will get destroyed whenever the shared context is lost | 79 // GLHelper will get destroyed whenever the shared context is lost |
85 // (ImageTransportFactoryObserver::OnLostResources is called). | 80 // (ImageTransportFactoryObserver::OnLostResources is called). |
86 virtual GLHelper* GetGLHelper() = 0; | 81 virtual GLHelper* GetGLHelper() = 0; |
87 | 82 |
88 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; | 83 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; |
89 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; | 84 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; |
90 }; | 85 }; |
91 | 86 |
92 } // namespace content | 87 } // namespace content |
93 | 88 |
94 #endif // CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ | 89 #endif // CONTENT_BROWSER_COMPOSITOR_IMAGE_TRANSPORT_FACTORY_H_ |
OLD | NEW |