| 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_BITMAP_IMPL_H_ | 5 #ifndef CC_BLINK_WEB_EXTERNAL_BITMAP_IMPL_H_ |
| 6 #define CC_BLINK_WEB_EXTERNAL_BITMAP_IMPL_H_ | 6 #define CC_BLINK_WEB_EXTERNAL_BITMAP_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "base/bind.h" | 12 #include "base/bind.h" |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "cc/blink/cc_blink_export.h" | 14 #include "cc/blink/cc_blink_export.h" |
| 14 #include "third_party/WebKit/public/platform/WebExternalBitmap.h" | 15 #include "third_party/WebKit/public/platform/WebExternalBitmap.h" |
| 15 | 16 |
| 16 namespace cc { | 17 namespace cc { |
| 17 class SharedBitmap; | 18 class SharedBitmap; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace cc_blink { | 21 namespace cc_blink { |
| 21 | 22 |
| 22 typedef scoped_ptr<cc::SharedBitmap>(*SharedBitmapAllocationFunction)( | 23 typedef std::unique_ptr<cc::SharedBitmap> (*SharedBitmapAllocationFunction)( |
| 23 const gfx::Size& size); | 24 const gfx::Size& size); |
| 24 | 25 |
| 25 // Sets the function that this will use to allocate shared memory. | 26 // Sets the function that this will use to allocate shared memory. |
| 26 CC_BLINK_EXPORT void SetSharedBitmapAllocationFunction( | 27 CC_BLINK_EXPORT void SetSharedBitmapAllocationFunction( |
| 27 SharedBitmapAllocationFunction); | 28 SharedBitmapAllocationFunction); |
| 28 | 29 |
| 29 class WebExternalBitmapImpl : public blink::WebExternalBitmap { | 30 class WebExternalBitmapImpl : public blink::WebExternalBitmap { |
| 30 public: | 31 public: |
| 31 CC_BLINK_EXPORT explicit WebExternalBitmapImpl(); | 32 CC_BLINK_EXPORT explicit WebExternalBitmapImpl(); |
| 32 virtual ~WebExternalBitmapImpl(); | 33 virtual ~WebExternalBitmapImpl(); |
| 33 | 34 |
| 34 // blink::WebExternalBitmap implementation. | 35 // blink::WebExternalBitmap implementation. |
| 35 blink::WebSize size() override; | 36 blink::WebSize size() override; |
| 36 void setSize(blink::WebSize size) override; | 37 void setSize(blink::WebSize size) override; |
| 37 uint8_t* pixels() override; | 38 uint8_t* pixels() override; |
| 38 | 39 |
| 39 cc::SharedBitmap* shared_bitmap() { return shared_bitmap_.get(); } | 40 cc::SharedBitmap* shared_bitmap() { return shared_bitmap_.get(); } |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 scoped_ptr<cc::SharedBitmap> shared_bitmap_; | 43 std::unique_ptr<cc::SharedBitmap> shared_bitmap_; |
| 43 blink::WebSize size_; | 44 blink::WebSize size_; |
| 44 | 45 |
| 45 DISALLOW_COPY_AND_ASSIGN(WebExternalBitmapImpl); | 46 DISALLOW_COPY_AND_ASSIGN(WebExternalBitmapImpl); |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 } // namespace cc_blink | 49 } // namespace cc_blink |
| 49 | 50 |
| 50 #endif // CC_BLINK_WEB_EXTERNAL_BITMAP_IMPL_H_ | 51 #endif // CC_BLINK_WEB_EXTERNAL_BITMAP_IMPL_H_ |
| OLD | NEW |