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