| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ | 5 #ifndef WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ |
| 6 #define WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ | 6 #define WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "cc/layers/texture_layer_client.h" | 11 #include "cc/layers/texture_layer_client.h" |
| 12 #include "cc/resources/texture_mailbox.h" | |
| 13 #include "third_party/WebKit/public/platform/WebExternalTextureLayer.h" | 12 #include "third_party/WebKit/public/platform/WebExternalTextureLayer.h" |
| 14 #include "webkit/renderer/compositor_bindings/webkit_compositor_bindings_export.
h" | 13 #include "webkit/renderer/compositor_bindings/webkit_compositor_bindings_export.
h" |
| 15 | 14 |
| 15 namespace cc { |
| 16 class ScopedReleaseCallback; |
| 17 class TextureMailbox; |
| 18 } |
| 19 |
| 16 namespace WebKit { | 20 namespace WebKit { |
| 17 struct WebFloatRect; | 21 struct WebFloatRect; |
| 18 struct WebExternalTextureMailbox; | 22 struct WebExternalTextureMailbox; |
| 19 } | 23 } |
| 20 | 24 |
| 21 namespace webkit { | 25 namespace webkit { |
| 22 | 26 |
| 23 class WebLayerImpl; | 27 class WebLayerImpl; |
| 24 class WebExternalBitmapImpl; | 28 class WebExternalBitmapImpl; |
| 25 | 29 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 36 virtual WebKit::WebLayer* layer(); | 40 virtual WebKit::WebLayer* layer(); |
| 37 virtual void clearTexture(); | 41 virtual void clearTexture(); |
| 38 virtual void setOpaque(bool opaque); | 42 virtual void setOpaque(bool opaque); |
| 39 virtual void setPremultipliedAlpha(bool premultiplied); | 43 virtual void setPremultipliedAlpha(bool premultiplied); |
| 40 virtual void setBlendBackgroundColor(bool blend); | 44 virtual void setBlendBackgroundColor(bool blend); |
| 41 virtual void setRateLimitContext(bool rate_limit); | 45 virtual void setRateLimitContext(bool rate_limit); |
| 42 | 46 |
| 43 // TextureLayerClient implementation. | 47 // TextureLayerClient implementation. |
| 44 virtual unsigned PrepareTexture() OVERRIDE; | 48 virtual unsigned PrepareTexture() OVERRIDE; |
| 45 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; | 49 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; |
| 46 virtual bool PrepareTextureMailbox(cc::TextureMailbox* mailbox, | 50 virtual bool PrepareTextureMailbox( |
| 47 bool use_shared_memory) OVERRIDE; | 51 cc::TextureMailbox* mailbox, |
| 52 cc::ScopedReleaseCallback* release_callback, |
| 53 bool use_shared_memory) OVERRIDE; |
| 48 | 54 |
| 49 private: | 55 private: |
| 50 static void DidReleaseMailbox( | 56 static void DidReleaseMailbox( |
| 51 base::WeakPtr<WebExternalTextureLayerImpl> layer, | 57 base::WeakPtr<WebExternalTextureLayerImpl> layer, |
| 52 const WebKit::WebExternalTextureMailbox& mailbox, | 58 const WebKit::WebExternalTextureMailbox& mailbox, |
| 53 WebExternalBitmapImpl* bitmap, | 59 WebExternalBitmapImpl* bitmap, |
| 54 unsigned sync_point, | 60 unsigned sync_point, |
| 55 bool lost_resource); | 61 bool lost_resource); |
| 56 | 62 |
| 57 WebExternalBitmapImpl* AllocateBitmap(); | 63 WebExternalBitmapImpl* AllocateBitmap(); |
| 58 | 64 |
| 59 WebKit::WebExternalTextureLayerClient* client_; | 65 WebKit::WebExternalTextureLayerClient* client_; |
| 60 scoped_ptr<WebLayerImpl> layer_; | 66 scoped_ptr<WebLayerImpl> layer_; |
| 61 ScopedVector<WebExternalBitmapImpl> free_bitmaps_; | 67 ScopedVector<WebExternalBitmapImpl> free_bitmaps_; |
| 62 | 68 |
| 63 DISALLOW_COPY_AND_ASSIGN(WebExternalTextureLayerImpl); | 69 DISALLOW_COPY_AND_ASSIGN(WebExternalTextureLayerImpl); |
| 64 }; | 70 }; |
| 65 | 71 |
| 66 } // namespace webkit | 72 } // namespace webkit |
| 67 | 73 |
| 68 #endif // WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H
_ | 74 #endif // WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H
_ |
| OLD | NEW |