OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_CLIENT_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_CLIENT_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "ui/gfx/compositor/compositor.h" |
| 11 #include "ui/gfx/surface/transport_dib.h" |
| 12 |
| 13 namespace gfx { |
| 14 class Size; |
| 15 } |
| 16 |
| 17 // This is a client for ImageTransportSurface, that handles the |
| 18 // platform-specific task of binding the transport surface to a GL texture. |
| 19 // The GL texture is allocated in the SharedResources context, and the data is |
| 20 // only valid between Acquire and Release. |
| 21 class ImageTransportClient { |
| 22 public: |
| 23 virtual ~ImageTransportClient() {} |
| 24 |
| 25 // Initializes the client with the surface id. This returns the GL texture id, |
| 26 // or 0 if error. |
| 27 virtual unsigned int Initialize(uint64* surface_id) = 0; |
| 28 |
| 29 // Gets the surface data into the texture. |
| 30 virtual void Acquire() = 0; |
| 31 |
| 32 // Releases the surface data. |
| 33 virtual void Release() = 0; |
| 34 |
| 35 // Returns whether the data is flipped in the Y direction. |
| 36 virtual bool Flipped() = 0; |
| 37 |
| 38 // Returns the shared memory handle used to transfer software data if needed. |
| 39 // Can be a NULL handle. |
| 40 virtual TransportDIB::Handle Handle() const = 0; |
| 41 |
| 42 // Creates a platform-specific client. |
| 43 static ImageTransportClient* Create(ui::SharedResources* resources, |
| 44 const gfx::Size& size); |
| 45 }; |
| 46 |
| 47 #endif // CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_CLIENT_H_ |
| 48 |
OLD | NEW |