| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CC_BLINK_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ | 5 #ifndef CC_BLINK_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ |
| 6 #define CC_BLINK_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ | 6 #define CC_BLINK_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/bind.h" | 11 #include "base/bind.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "cc/blink/cc_blink_export.h" | 13 #include "cc/blink/cc_blink_export.h" |
| 14 #include "cc/layers/texture_layer_client.h" | 14 #include "cc/layers/texture_layer_client.h" |
| 15 #include "third_party/WebKit/public/platform/WebExternalTextureLayer.h" | 15 #include "third_party/WebKit/public/platform/WebExternalTextureLayer.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 class WebExternalTextureLayerClient; | 18 class WebExternalTextureLayerClient; |
| 19 struct WebFloatRect; | 19 struct WebFloatRect; |
| 20 struct WebExternalTextureMailbox; | 20 struct WebExternalTextureMailbox; |
| 21 } | 21 } |
| 22 | 22 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 blink::WebLayer* layer() override; | 43 blink::WebLayer* layer() override; |
| 44 void clearTexture() override; | 44 void clearTexture() override; |
| 45 void setOpaque(bool opaque) override; | 45 void setOpaque(bool opaque) override; |
| 46 void setPremultipliedAlpha(bool premultiplied) override; | 46 void setPremultipliedAlpha(bool premultiplied) override; |
| 47 void setBlendBackgroundColor(bool blend) override; | 47 void setBlendBackgroundColor(bool blend) override; |
| 48 void setNearestNeighbor(bool nearest_neighbor) override; | 48 void setNearestNeighbor(bool nearest_neighbor) override; |
| 49 | 49 |
| 50 // TextureLayerClient implementation. | 50 // TextureLayerClient implementation. |
| 51 bool PrepareTextureMailbox( | 51 bool PrepareTextureMailbox( |
| 52 cc::TextureMailbox* mailbox, | 52 cc::TextureMailbox* mailbox, |
| 53 scoped_ptr<cc::SingleReleaseCallback>* release_callback, | 53 std::unique_ptr<cc::SingleReleaseCallback>* release_callback, |
| 54 bool use_shared_memory) override; | 54 bool use_shared_memory) override; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 static void DidReleaseMailbox( | 57 static void DidReleaseMailbox( |
| 58 base::WeakPtr<WebExternalTextureLayerImpl> layer, | 58 base::WeakPtr<WebExternalTextureLayerImpl> layer, |
| 59 const blink::WebExternalTextureMailbox& mailbox, | 59 const blink::WebExternalTextureMailbox& mailbox, |
| 60 WebExternalBitmapImpl* bitmap, | 60 WebExternalBitmapImpl* bitmap, |
| 61 const gpu::SyncToken& sync_token, | 61 const gpu::SyncToken& sync_token, |
| 62 bool lost_resource); | 62 bool lost_resource); |
| 63 | 63 |
| 64 WebExternalBitmapImpl* AllocateBitmap(); | 64 WebExternalBitmapImpl* AllocateBitmap(); |
| 65 | 65 |
| 66 blink::WebExternalTextureLayerClient* client_; | 66 blink::WebExternalTextureLayerClient* client_; |
| 67 scoped_ptr<WebLayerImpl> layer_; | 67 std::unique_ptr<WebLayerImpl> layer_; |
| 68 std::vector<scoped_ptr<WebExternalBitmapImpl>> free_bitmaps_; | 68 std::vector<std::unique_ptr<WebExternalBitmapImpl>> free_bitmaps_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(WebExternalTextureLayerImpl); | 70 DISALLOW_COPY_AND_ASSIGN(WebExternalTextureLayerImpl); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace cc_blink | 73 } // namespace cc_blink |
| 74 | 74 |
| 75 #endif // CC_BLINK_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ | 75 #endif // CC_BLINK_WEB_EXTERNAL_TEXTURE_LAYER_IMPL_H_ |
| OLD | NEW |