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