7e685302b9
BUG= R=blois@google.com Review URL: https://codereview.chromium.org//34733007 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29135 260f80e4-7a28-3924-810f-c04153c831b5
96 lines
3.2 KiB
Plaintext
96 lines
3.2 KiB
Plaintext
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
part of $LIBRARYNAME;
|
|
|
|
$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
|
|
$!MEMBERS
|
|
|
|
/**
|
|
* Sets the currently bound texture to [data].
|
|
*
|
|
* [data] can be either an [ImageElement], a
|
|
* [CanvasElement], a [VideoElement], or an [ImageData] object.
|
|
*
|
|
* To use [texImage2d] with a TypedData object, use [texImage2dTyped].
|
|
*
|
|
*/
|
|
$if DART2JS
|
|
@JSName('texImage2D')
|
|
void texImage2DUntyped(int targetTexture, int levelOfDetail,
|
|
int internalFormat, int format, int type, data) native;
|
|
$else
|
|
void texImage2DUntyped(int targetTexture, int levelOfDetail,
|
|
int internalFormat, int format, int type, data) {
|
|
if (data is ImageElement) {
|
|
texImage2DImage(targetTexture, levelOfDetail, internalFormat, format,
|
|
type, data);
|
|
} else if (data is ImageData) {
|
|
texImage2DImageData(targetTexture, levelOfDetail, internalFormat, format,
|
|
type, data);
|
|
} else if (data is CanvasElement) {
|
|
texImage2DCanvas(targetTexture, levelOfDetail, internalFormat, format,
|
|
type, data);
|
|
} else {
|
|
texImage2DVideo(targetTexture, levelOfDetail, internalFormat, format,
|
|
type, data);
|
|
}
|
|
}
|
|
$endif
|
|
|
|
/**
|
|
* Sets the currently bound texture to [data].
|
|
*/
|
|
$if DART2JS
|
|
@JSName('texImage2D')
|
|
void texImage2DTyped(int targetTexture, int levelOfDetail,
|
|
int internalFormat, int width, int height, int border, int format,
|
|
int type, TypedData data) native;
|
|
$else
|
|
void texImage2DTyped(int targetTexture, int levelOfDetail, int internalFormat,
|
|
int width, int height, int border, int format, int type, TypedData data) {
|
|
texImage2D(targetTexture, levelOfDetail, internalFormat,
|
|
width, height, border, format, type, data);
|
|
}
|
|
$endif
|
|
|
|
/**
|
|
* Updates a sub-rectangle of the currently bound texture to [data].
|
|
*
|
|
* [data] can be either an [ImageElement], a
|
|
* [CanvasElement], a [VideoElement], or an [ImageData] object.
|
|
*
|
|
* To use [texSubImage2d] with a TypedData object, use [texSubImage2dTyped].
|
|
*
|
|
*/
|
|
$if DART2JS
|
|
@JSName('texSubImage2D')
|
|
void texSubImage2DUntyped(int targetTexture, int levelOfDetail,
|
|
int internalFormat, int format, int type, data) native;
|
|
$else
|
|
void texSubImage2DUntyped(int targetTexture, int levelOfDetail,
|
|
int internalFormat, int format, int type, data) {
|
|
texSubImage2D(targetTexture, levelOfDetail, internalFormat,
|
|
format, type, data);
|
|
}
|
|
$endif
|
|
|
|
/**
|
|
* Updates a sub-rectangle of the currently bound texture to [data].
|
|
*/
|
|
$if DART2JS
|
|
@JSName('texSubImage2D')
|
|
void texSubImage2DTyped(int targetTexture, int levelOfDetail,
|
|
int internalFormat, int width, int height, int border, int format,
|
|
int type, TypedData data) native;
|
|
$else
|
|
void texSubImage2DTyped(int targetTexture, int levelOfDetail,
|
|
int internalFormat, int width, int height, int border, int format,
|
|
int type, TypedData data) {
|
|
texSubImage2D(targetTexture, levelOfDetail, internalFormat,
|
|
width, height, border, format, type, data);
|
|
}
|
|
$endif
|
|
}
|