| Index: sky/engine/bindings-dart/core/dart/custom/DartImageDataCustom.cpp
|
| diff --git a/LICENSE b/sky/engine/bindings-dart/core/dart/custom/DartImageDataCustom.cpp
|
| similarity index 57%
|
| copy from LICENSE
|
| copy to sky/engine/bindings-dart/core/dart/custom/DartImageDataCustom.cpp
|
| index 972bb2edb099e58b6a1939fa57f8e74391159c0c..df3d9e3d21fa63f599a005f56910758e50225fab 100644
|
| --- a/LICENSE
|
| +++ b/sky/engine/bindings-dart/core/dart/custom/DartImageDataCustom.cpp
|
| @@ -1,4 +1,5 @@
|
| -// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Copyright 2011, Google Inc.
|
| +// All rights reserved.
|
| //
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| @@ -25,3 +26,44 @@
|
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| +
|
| +#include "config.h"
|
| +#include "bindings/core/dart/DartImageData.h"
|
| +
|
| +#include "bindings/core/dart/DartDOMWrapper.h"
|
| +
|
| +namespace blink {
|
| +
|
| +Dart_Handle DartImageData::createWrapper(
|
| + DartDOMData* domData, ImageData* imageData)
|
| +{
|
| + if (!imageData)
|
| + return Dart_Null();
|
| +
|
| + // FIMXE: In JavaScript bindings "data" property of the ImageData wrapper is
|
| + // set to imageData->data to eliminate the C++ callback when accessing the
|
| + // "data" property.
|
| + return DartDOMWrapper::createWrapper<DartImageData>(domData, imageData);
|
| +}
|
| +
|
| +namespace DartImageDataInternal {
|
| +
|
| +// Another approach would be to set a field while constructing an object
|
| +// like v8 does, however, I hope eventually to move this call into
|
| +// field initialisation step.
|
| +void dataGetter(Dart_NativeArguments args)
|
| +{
|
| + {
|
| + ImageData* receiver = DartDOMWrapper::receiver<ImageData>(args);
|
| +
|
| + Dart_Handle wrapper = DartUtilities::arrayBufferViewToDart(receiver->data());
|
| + ASSERT(!Dart_IsError(wrapper));
|
| +
|
| + Dart_SetReturnValue(args, wrapper);
|
| + return;
|
| + }
|
| +}
|
| +
|
| +}
|
| +
|
| +}
|
|
|