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.
5 #include "cc/blink/web_external_bitmap_impl.h"
7 #include "cc/resources/shared_bitmap.h"
13 SharedBitmapAllocationFunction g_memory_allocator
;
17 void SetSharedBitmapAllocationFunction(
18 SharedBitmapAllocationFunction allocator
) {
19 g_memory_allocator
= allocator
;
22 WebExternalBitmapImpl::WebExternalBitmapImpl() {
25 WebExternalBitmapImpl::~WebExternalBitmapImpl() {
28 void WebExternalBitmapImpl::setSize(blink::WebSize size
) {
30 shared_bitmap_
= g_memory_allocator(gfx::Size(size
));
35 blink::WebSize
WebExternalBitmapImpl::size() {
39 uint8
* WebExternalBitmapImpl::pixels() {
40 return shared_bitmap_
->pixels();
43 } // namespace cc_blink