| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ | |
| 6 #define WEBKIT_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ | |
| 7 | |
| 8 #include "base/bind.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "cc/layers/texture_layer_client.h" | |
| 11 #include "cc/resources/texture_mailbox.h" | |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL
ayer.h" | |
| 13 #include "webkit/compositor_bindings/webkit_compositor_bindings_export.h" | |
| 14 | |
| 15 namespace WebKit { | |
| 16 struct WebFloatRect; | |
| 17 struct WebExternalTextureMailbox; | |
| 18 } | |
| 19 | |
| 20 namespace webkit { | |
| 21 | |
| 22 class WebLayerImpl; | |
| 23 | |
| 24 class WebExternalTextureLayerImpl | |
| 25 : public WebKit::WebExternalTextureLayer, | |
| 26 public cc::TextureLayerClient, | |
| 27 public base::SupportsWeakPtr<WebExternalTextureLayerImpl> { | |
| 28 public: | |
| 29 WEBKIT_COMPOSITOR_BINDINGS_EXPORT explicit WebExternalTextureLayerImpl( | |
| 30 WebKit::WebExternalTextureLayerClient*, | |
| 31 bool mailbox); | |
| 32 virtual ~WebExternalTextureLayerImpl(); | |
| 33 | |
| 34 // WebKit::WebExternalTextureLayer implementation. | |
| 35 virtual WebKit::WebLayer* layer(); | |
| 36 virtual void clearTexture(); | |
| 37 virtual void setTextureId(unsigned texture_id); | |
| 38 virtual void setFlipped(bool flipped); | |
| 39 virtual void setUVRect(const WebKit::WebFloatRect& uv_rect); | |
| 40 virtual void setOpaque(bool opaque); | |
| 41 virtual void setPremultipliedAlpha(bool premultiplied); | |
| 42 | |
| 43 virtual void willModifyTexture(); | |
| 44 virtual void setRateLimitContext(bool rate_limit); | |
| 45 | |
| 46 // TextureLayerClient implementation. | |
| 47 virtual unsigned PrepareTexture(cc::ResourceUpdateQueue*) OVERRIDE; | |
| 48 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; | |
| 49 virtual bool PrepareTextureMailbox(cc::TextureMailbox* mailbox) OVERRIDE; | |
| 50 | |
| 51 private: | |
| 52 void DidReleaseMailbox(const WebKit::WebExternalTextureMailbox& mailbox, | |
| 53 unsigned sync_point, | |
| 54 bool lost_resource); | |
| 55 | |
| 56 WebKit::WebExternalTextureLayerClient* client_; | |
| 57 scoped_ptr<WebLayerImpl> layer_; | |
| 58 bool uses_mailbox_; | |
| 59 | |
| 60 DISALLOW_COPY_AND_ASSIGN(WebExternalTextureLayerImpl); | |
| 61 }; | |
| 62 | |
| 63 } // namespace webkit | |
| 64 | |
| 65 #endif // WEBKIT_COMPOSITOR_BINDINGS_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ | |
| OLD | NEW |