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