| 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 <string> |
| 9 |
| 8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 9 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
| 10 | 12 |
| 11 namespace gfx { | 13 namespace gfx { |
| 12 class Size; | 14 class Size; |
| 13 } | 15 } |
| 14 | 16 |
| 15 namespace ui { | 17 namespace ui { |
| 16 class ContextFactory; | 18 class ContextFactory; |
| 17 class Texture; | 19 class Texture; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 virtual gfx::GLSurfaceHandle CreateSharedSurfaceHandle() = 0; | 68 virtual gfx::GLSurfaceHandle CreateSharedSurfaceHandle() = 0; |
| 67 | 69 |
| 68 // Destroys a shared surface handle. | 70 // Destroys a shared surface handle. |
| 69 virtual void DestroySharedSurfaceHandle(gfx::GLSurfaceHandle surface) = 0; | 71 virtual void DestroySharedSurfaceHandle(gfx::GLSurfaceHandle surface) = 0; |
| 70 | 72 |
| 71 // Creates a transport texture of a given size and scale factor, and using the | 73 // Creates a transport texture of a given size and scale factor, and using the |
| 72 // opaque handle sent by the GPU process. | 74 // opaque handle sent by the GPU process. |
| 73 virtual scoped_refptr<ui::Texture> CreateTransportClient( | 75 virtual scoped_refptr<ui::Texture> CreateTransportClient( |
| 74 const gfx::Size& size, | 76 const gfx::Size& size, |
| 75 float device_scale_factor, | 77 float device_scale_factor, |
| 76 uint64 transport_handle) = 0; | 78 const std::string& mailbox_name) = 0; |
| 77 | 79 |
| 78 // Variant of CreateTransportClient() that deletes the texture on the GPU when | 80 // Variant of CreateTransportClient() that deletes the texture on the GPU when |
| 79 // the returned value is deleted. | 81 // the returned value is deleted. |
| 80 virtual scoped_refptr<ui::Texture> CreateOwnedTexture( | 82 virtual scoped_refptr<ui::Texture> CreateOwnedTexture( |
| 81 const gfx::Size& size, | 83 const gfx::Size& size, |
| 82 float device_scale_factor, | 84 float device_scale_factor, |
| 83 unsigned int texture_id) = 0; | 85 unsigned int texture_id) = 0; |
| 84 | 86 |
| 85 // Gets a GLHelper instance, associated with the shared context. This | 87 // Gets a GLHelper instance, associated with the shared context. This |
| 86 // GLHelper will get destroyed whenever the shared context is lost | 88 // GLHelper will get destroyed whenever the shared context is lost |
| 87 // (ImageTransportFactoryObserver::OnLostResources is called). | 89 // (ImageTransportFactoryObserver::OnLostResources is called). |
| 88 virtual GLHelper* GetGLHelper() = 0; | 90 virtual GLHelper* GetGLHelper() = 0; |
| 89 | 91 |
| 90 // Inserts a SyncPoint into the shared context. | 92 // Inserts a SyncPoint into the shared context. |
| 91 virtual uint32 InsertSyncPoint() = 0; | 93 virtual uint32 InsertSyncPoint() = 0; |
| 92 | 94 |
| 93 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; | 95 virtual void AddObserver(ImageTransportFactoryObserver* observer) = 0; |
| 94 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; | 96 virtual void RemoveObserver(ImageTransportFactoryObserver* observer) = 0; |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 } // namespace content | 99 } // namespace content |
| 98 | 100 |
| 99 #endif // CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_H_ | 101 #endif // CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_H_ |
| OLD | NEW |