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