Upstreaming changes from android.
- fix compile warnings in the GPU code
- upstream android specific code (ifdef protected)
- fail gracefully when a custom allocator fails
git-svn-id: http://skia.googlecode.com/svn/trunk@936 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/utils/SkCamera.cpp b/src/utils/SkCamera.cpp
index b02499f..87d2aad 100644
--- a/src/utils/SkCamera.cpp
+++ b/src/utils/SkCamera.cpp
@@ -400,6 +400,18 @@
fRec = next;
}
+#ifdef ANDROID
+void Sk3DView::setCameraLocation(SkScalar x, SkScalar y, SkScalar z)
+{
+ // the camera location is passed in inches, set in pt
+ SkScalar lz = z * SkFloatToScalar(72.0f);
+ fCamera.fLocation.set(x * SkFloatToScalar(72.0f), y * SkFloatToScalar(72.0f), lz);
+ fCamera.fObserver.set(0, 0, lz);
+ fCamera.update();
+
+}
+#endif
+
void Sk3DView::translate(SkScalar x, SkScalar y, SkScalar z)
{
fRec->fMatrix.preTranslate(x, y, z);