Chromium Code Reviews| 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_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ | 5 #ifndef WEBKIT_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ |
| 6 #define WEBKIT_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ | 6 #define WEBKIT_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/bind.h" | |
| 8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "cc/layers/texture_layer_client.h" | 10 #include "cc/layers/texture_layer_client.h" |
| 11 #include "cc/resources/texture_mailbox.h" | |
| 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL ayer.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL ayer.h" |
| 11 #include "webkit/compositor_bindings/webkit_compositor_bindings_export.h" | 13 #include "webkit/compositor_bindings/webkit_compositor_bindings_export.h" |
| 12 | 14 |
| 13 namespace WebKit { struct WebFloatRect; } | 15 namespace WebKit { |
| 16 struct WebFloatRect; | |
| 17 struct WebExternalTextureMailbox; | |
| 18 } | |
| 14 | 19 |
| 15 namespace webkit { | 20 namespace webkit { |
| 16 | 21 |
| 17 class WebLayerImpl; | 22 class WebLayerImpl; |
| 18 | 23 |
| 19 class WebExternalTextureLayerImpl : public WebKit::WebExternalTextureLayer, | 24 class WebExternalTextureLayerImpl |
| 20 public cc::TextureLayerClient { | 25 : public WebKit::WebExternalTextureLayer, |
| 26 public cc::TextureLayerClient, | |
| 27 public base::SupportsWeakPtr<WebExternalTextureLayerImpl> { | |
| 21 public: | 28 public: |
| 22 WEBKIT_COMPOSITOR_BINDINGS_EXPORT explicit WebExternalTextureLayerImpl( | 29 WEBKIT_COMPOSITOR_BINDINGS_EXPORT explicit WebExternalTextureLayerImpl( |
| 23 WebKit::WebExternalTextureLayerClient*); | 30 WebKit::WebExternalTextureLayerClient*, |
| 31 bool mailbox); | |
| 24 virtual ~WebExternalTextureLayerImpl(); | 32 virtual ~WebExternalTextureLayerImpl(); |
| 25 | 33 |
| 26 // WebKit::WebExternalTextureLayer implementation. | 34 // WebKit::WebExternalTextureLayer implementation. |
| 27 virtual WebKit::WebLayer* layer(); | 35 virtual WebKit::WebLayer* layer(); |
| 36 virtual void clearTexture(); | |
| 28 virtual void setTextureId(unsigned texture_id); | 37 virtual void setTextureId(unsigned texture_id); |
| 29 virtual void setFlipped(bool flipped); | 38 virtual void setFlipped(bool flipped); |
| 30 virtual void setUVRect(const WebKit::WebFloatRect& uv_rect); | 39 virtual void setUVRect(const WebKit::WebFloatRect& uv_rect); |
| 31 virtual void setOpaque(bool opaque); | 40 virtual void setOpaque(bool opaque); |
| 32 virtual void setPremultipliedAlpha(bool premultiplied); | 41 virtual void setPremultipliedAlpha(bool premultiplied); |
| 42 | |
| 33 virtual void willModifyTexture(); | 43 virtual void willModifyTexture(); |
| 34 virtual void setRateLimitContext(bool rate_limit); | 44 virtual void setRateLimitContext(bool rate_limit); |
| 35 | 45 |
| 36 // TextureLayerClient implementation. | 46 // TextureLayerClient implementation. |
| 37 virtual unsigned PrepareTexture(cc::ResourceUpdateQueue*) OVERRIDE; | 47 virtual unsigned PrepareTexture(cc::ResourceUpdateQueue*) OVERRIDE; |
| 38 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; | 48 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; |
| 49 virtual bool PrepareTextureMailbox(cc::TextureMailbox*) OVERRIDE; | |
|
jamesr
2013/04/11 17:36:58
parameter needs a name
| |
| 39 | 50 |
| 40 private: | 51 private: |
| 52 void mailboxReleased(const WebKit::WebExternalTextureMailbox &mailbox, | |
|
jamesr
2013/04/11 17:36:58
use Chromium naming style for functions that aren'
alexst (slow to review)
2013/04/11 18:03:12
Yes, it's called when a mailbox is no longer in us
| |
| 53 unsigned sync_point, | |
| 54 bool lost_resource); | |
| 55 | |
| 41 WebKit::WebExternalTextureLayerClient* client_; | 56 WebKit::WebExternalTextureLayerClient* client_; |
| 42 scoped_ptr<WebLayerImpl> layer_; | 57 scoped_ptr<WebLayerImpl> layer_; |
| 58 bool uses_mailbox_; | |
| 43 | 59 |
| 44 DISALLOW_COPY_AND_ASSIGN(WebExternalTextureLayerImpl); | 60 DISALLOW_COPY_AND_ASSIGN(WebExternalTextureLayerImpl); |
| 45 }; | 61 }; |
| 46 | 62 |
| 47 } // namespace webkit | 63 } // namespace webkit |
| 48 | 64 |
| 49 #endif // WEBKIT_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ | 65 #endif // WEBKIT_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ |
| OLD | NEW |