Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: sdk/lib/web_gl/dartium/web_gl_dartium.dart

Issue 2975953002: Fixed readPixels not working in Dartium. (Closed)
Patch Set: Updated to latest WebKit (exposed Dart_TypedArray_ArrayBufferView). Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/web_gl/dart2js/web_gl_dart2js.dart ('k') | tools/deps/dartium.deps/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/web_gl/dartium/web_gl_dartium.dart
diff --git a/sdk/lib/web_gl/dartium/web_gl_dartium.dart b/sdk/lib/web_gl/dartium/web_gl_dartium.dart
index 87057df40f363446c1ff74ee85c2a0992fab0f31..3a3175e7828d8d647ca3c6605c59578b4be6b80a 100644
--- a/sdk/lib/web_gl/dartium/web_gl_dartium.dart
+++ b/sdk/lib/web_gl/dartium/web_gl_dartium.dart
@@ -3537,7 +3537,7 @@ class RenderingContext extends DartHtmlDomObject
@DomName('WebGLRenderingContext.readPixels')
@DocsEditable()
- void readPixels(int x, int y, int width, int height, int format, int type,
+ void _readPixels(int x, int y, int width, int height, int format, int type,
TypedData pixels) =>
_blink.BlinkWebGLRenderingContext.instance.readPixels_Callback_7_(
this, x, y, width, height, format, type, pixels);
@@ -4213,6 +4213,17 @@ class RenderingContext extends DartHtmlDomObject
_blink.BlinkWebGLRenderingContext.instance
.viewport_Callback_4_(this, x, y, width, height);
+ @DomName('WebGLRenderingContext.readPixels')
+ @DocsEditable()
+ void readPixels(int x, int y, int width, int height, int format, int type,
+ TypedData pixels) {
+ var data = js.toArrayBufferView(pixels);
+ _readPixels(x, y, width, height, format, type, data);
+ for (var i = 0; i < data.length; i++) {
+ pixels[i] = data[i];
+ }
+ }
+
/**
* Sets the currently bound texture to [data].
*
@@ -4289,12 +4300,10 @@ class RenderingContext extends DartHtmlDomObject
bufferSubData(target, offset, data);
}
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// 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.
-// WARNING: Do not edit - generated code.
-
@DocsEditable()
@DomName('WebGL2RenderingContext')
@Experimental() // untriaged
@@ -7478,7 +7487,7 @@ class RenderingContext2 extends DartHtmlDomObject
@DomName('WebGL2RenderingContext.readPixels')
@DocsEditable()
@Experimental() // untriaged
- void readPixels(int x, int y, int width, int height, int format, int type,
+ void _readPixels(int x, int y, int width, int height, int format, int type,
TypedData pixels) =>
_blink.BlinkWebGL2RenderingContext.instance.readPixels_Callback_7_(
this, x, y, width, height, format, type, pixels);
@@ -8182,7 +8191,19 @@ class RenderingContext2 extends DartHtmlDomObject
void viewport(int x, int y, int width, int height) =>
_blink.BlinkWebGL2RenderingContext.instance
.viewport_Callback_4_(this, x, y, width, height);
+
+ @DomName('WebGLRenderingContext2.readPixels')
+ @DocsEditable()
+ void readPixels(int x, int y, int width, int height, int format, int type,
+ TypedData pixels) {
+ var data = js.toArrayBufferView(pixels);
+ _readPixels(x, y, width, height, format, type, data);
+ for (var i = 0; i < data.length; i++) {
+ pixels[i] = data[i];
+ }
+ }
}
+
// Copyright (c) 2012, 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.
« no previous file with comments | « sdk/lib/web_gl/dart2js/web_gl_dart2js.dart ('k') | tools/deps/dartium.deps/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698