| 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_CLIENT_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_CLIENT_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_CLIENT_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_CLIENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "ui/compositor/compositor.h" | 10 #include "ui/compositor/compositor.h" |
| 11 #include "ui/surface/transport_dib.h" | 11 #include "ui/surface/transport_dib.h" |
| 12 | 12 |
| 13 namespace gfx { | 13 namespace gfx { |
| 14 class Size; | 14 class Size; |
| 15 } | 15 } |
| 16 class ImageTransportFactory; | 16 class ImageTransportFactory; |
| 17 | 17 |
| 18 // This is a client for ImageTransportSurface, that handles the | 18 // This is a client for ImageTransportSurface, that handles the |
| 19 // platform-specific task of binding the transport surface to a GL texture. | 19 // platform-specific task of binding the transport surface to a GL texture. |
| 20 // The GL texture is allocated in the ImageTransportFactory context, and the | 20 // The GL texture is allocated in the ImageTransportFactory context, and the |
| 21 // data is only valid after the first Update(). | 21 // data is only valid after the first Update(). |
| 22 class ImageTransportClient : public ui::Texture { | 22 class ImageTransportClient : public ui::Texture { |
| 23 public: | 23 public: |
| 24 virtual ~ImageTransportClient() {} | |
| 25 | |
| 26 // Initializes the client with the surface id. | 24 // Initializes the client with the surface id. |
| 27 virtual bool Initialize(uint64* surface_handle) = 0; | 25 virtual bool Initialize(uint64* surface_handle) = 0; |
| 28 | 26 |
| 29 // Updates the surface data into the texture. | 27 // Updates the surface data into the texture. |
| 30 virtual void Update() = 0; | 28 virtual void Update() = 0; |
| 31 | 29 |
| 32 // Returns the shared memory handle used to transfer software data if needed. | 30 // Returns the shared memory handle used to transfer software data if needed. |
| 33 // Can be a NULL handle. | 31 // Can be a NULL handle. |
| 34 virtual TransportDIB::Handle Handle() const = 0; | 32 virtual TransportDIB::Handle Handle() const = 0; |
| 35 | 33 |
| 36 // Creates a platform-specific client. | 34 // Creates a platform-specific client. |
| 37 static ImageTransportClient* Create(ImageTransportFactory* factory, | 35 static ImageTransportClient* Create(ImageTransportFactory* factory, |
| 38 const gfx::Size& size); | 36 const gfx::Size& size); |
| 39 | 37 |
| 40 protected: | 38 protected: |
| 41 ImageTransportClient(bool flipped, const gfx::Size& size); | 39 ImageTransportClient(bool flipped, const gfx::Size& size); |
| 40 virtual ~ImageTransportClient() {} |
| 42 | 41 |
| 43 private: | 42 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(ImageTransportClient); | 43 DISALLOW_COPY_AND_ASSIGN(ImageTransportClient); |
| 45 }; | 44 }; |
| 46 | 45 |
| 47 #endif // CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_CLIENT_H_ | 46 #endif // CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_CLIENT_H_ |
| 48 | 47 |
| OLD | NEW |