am af80cdd7: Merge "DdmServer: add controls for OpenGL tracing"
* commit 'af80cdd7dfa28158fa91ab374d8e6d2500de66b1':
DdmServer: add controls for OpenGL tracing
diff --git a/core/java/android/view/GLES20Canvas.java b/core/java/android/view/GLES20Canvas.java
index b64a06e..53b6464 100644
--- a/core/java/android/view/GLES20Canvas.java
+++ b/core/java/android/view/GLES20Canvas.java
@@ -515,22 +515,22 @@
@Override
public boolean quickReject(float left, float top, float right, float bottom, EdgeType type) {
- return nQuickReject(mRenderer, left, top, right, bottom, type.nativeInt);
+ return nQuickReject(mRenderer, left, top, right, bottom);
}
private static native boolean nQuickReject(int renderer, float left, float top,
- float right, float bottom, int edge);
+ float right, float bottom);
@Override
public boolean quickReject(Path path, EdgeType type) {
path.computeBounds(mPathBounds, true);
return nQuickReject(mRenderer, mPathBounds.left, mPathBounds.top,
- mPathBounds.right, mPathBounds.bottom, type.nativeInt);
+ mPathBounds.right, mPathBounds.bottom);
}
@Override
public boolean quickReject(RectF rect, EdgeType type) {
- return nQuickReject(mRenderer, rect.left, rect.top, rect.right, rect.bottom, type.nativeInt);
+ return nQuickReject(mRenderer, rect.left, rect.top, rect.right, rect.bottom);
}
///////////////////////////////////////////////////////////////////////////
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index d3ba11a..07e520b 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -160,6 +160,7 @@
external/skia/include/effects \
external/skia/include/images \
external/skia/include/ports \
+ external/skia/src/core \
external/skia/src/ports \
external/skia/include/utils \
external/sqlite/dist \
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index 1fb8c91..0e7d5091 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -231,7 +231,7 @@
}
SkAutoTDelete<SkImageDecoder> add(decoder);
- SkAutoTDelete<SkBitmap> adb(bitmap, !useExistingBitmap);
+ SkAutoTDelete<SkBitmap> adb(!useExistingBitmap ? bitmap : NULL);
decoder->setPeeker(&peeker);
if (!isPurgeable) {
diff --git a/core/jni/android/graphics/Canvas.cpp b/core/jni/android/graphics/Canvas.cpp
index 5d6f738..ef9b96e 100644
--- a/core/jni/android/graphics/Canvas.cpp
+++ b/core/jni/android/graphics/Canvas.cpp
@@ -278,25 +278,25 @@
canvas->setDrawFilter(filter);
}
- static jboolean quickReject__RectFI(JNIEnv* env, jobject, SkCanvas* canvas,
- jobject rect, int edgetype) {
+ static jboolean quickReject__RectF(JNIEnv* env, jobject, SkCanvas* canvas,
+ jobject rect) {
SkRect rect_;
GraphicsJNI::jrectf_to_rect(env, rect, &rect_);
- return canvas->quickReject(rect_, (SkCanvas::EdgeType)edgetype);
+ return canvas->quickReject(rect_);
}
-
- static jboolean quickReject__PathI(JNIEnv* env, jobject, SkCanvas* canvas,
- SkPath* path, int edgetype) {
- return canvas->quickReject(*path, (SkCanvas::EdgeType)edgetype);
+
+ static jboolean quickReject__Path(JNIEnv* env, jobject, SkCanvas* canvas,
+ SkPath* path) {
+ return canvas->quickReject(*path);
}
-
- static jboolean quickReject__FFFFI(JNIEnv* env, jobject, SkCanvas* canvas,
+
+ static jboolean quickReject__FFFF(JNIEnv* env, jobject, SkCanvas* canvas,
jfloat left, jfloat top, jfloat right,
- jfloat bottom, int edgetype) {
+ jfloat bottom) {
SkRect r;
r.set(SkFloatToScalar(left), SkFloatToScalar(top),
SkFloatToScalar(right), SkFloatToScalar(bottom));
- return canvas->quickReject(r, (SkCanvas::EdgeType)edgetype);
+ return canvas->quickReject(r);
}
static void drawRGB(JNIEnv* env, jobject, SkCanvas* canvas,
@@ -938,12 +938,19 @@
jobject bounds) {
SkRect r;
SkIRect ir;
- bool result = canvas->getClipBounds(&r, SkCanvas::kBW_EdgeType);
+ bool result = canvas->getClipBounds(&r);
if (!result) {
r.setEmpty();
+ } else {
+ // ensure the clip is not larger than the canvas
+ SkRect canvasRect;
+ SkISize deviceSize = canvas->getDeviceSize();
+ canvasRect.iset(0, 0, deviceSize.fWidth, deviceSize.fHeight);
+ r.intersect(canvasRect);
}
r.round(&ir);
+
(void)GraphicsJNI::irect_to_jrect(ir, env, bounds);
return result;
}
@@ -992,10 +999,10 @@
{"native_getClipBounds","(ILandroid/graphics/Rect;)Z",
(void*) SkCanvasGlue::getClipBounds},
{"native_getCTM", "(II)V", (void*)SkCanvasGlue::getCTM},
- {"native_quickReject","(ILandroid/graphics/RectF;I)Z",
- (void*) SkCanvasGlue::quickReject__RectFI},
- {"native_quickReject","(III)Z", (void*) SkCanvasGlue::quickReject__PathI},
- {"native_quickReject","(IFFFFI)Z", (void*)SkCanvasGlue::quickReject__FFFFI},
+ {"native_quickReject","(ILandroid/graphics/RectF;)Z",
+ (void*) SkCanvasGlue::quickReject__RectF},
+ {"native_quickReject","(II)Z", (void*) SkCanvasGlue::quickReject__Path},
+ {"native_quickReject","(IFFFF)Z", (void*)SkCanvasGlue::quickReject__FFFF},
{"native_drawRGB","(IIII)V", (void*) SkCanvasGlue::drawRGB},
{"native_drawARGB","(IIIII)V", (void*) SkCanvasGlue::drawARGB},
{"native_drawColor","(II)V", (void*) SkCanvasGlue::drawColor__I},
diff --git a/core/jni/android/graphics/NinePatchImpl.cpp b/core/jni/android/graphics/NinePatchImpl.cpp
index ff0eb45..01e7e3e 100644
--- a/core/jni/android/graphics/NinePatchImpl.cpp
+++ b/core/jni/android/graphics/NinePatchImpl.cpp
@@ -105,7 +105,7 @@
void NinePatch_Draw(SkCanvas* canvas, const SkRect& bounds,
const SkBitmap& bitmap, const android::Res_png_9patch& chunk,
const SkPaint* paint, SkRegion** outRegion) {
- if (canvas && canvas->quickReject(bounds, SkCanvas::kBW_EdgeType)) {
+ if (canvas && canvas->quickReject(bounds)) {
return;
}
diff --git a/core/jni/android/graphics/Region.cpp b/core/jni/android/graphics/Region.cpp
index 866d223..b0262a2 100644
--- a/core/jni/android/graphics/Region.cpp
+++ b/core/jni/android/graphics/Region.cpp
@@ -177,7 +177,7 @@
SkRegion* region = new SkRegion;
size_t size = p->readInt32();
- region->unflatten(p->readInplace(size));
+ region->readFromMemory(p->readInplace(size));
return region;
}
@@ -190,9 +190,9 @@
android::Parcel* p = android::parcelForJavaObject(env, parcel);
- size_t size = region->flatten(NULL);
+ size_t size = region->writeToMemory(NULL);
p->writeInt32(size);
- region->flatten(p->writeInplace(size));
+ region->writeToMemory(p->writeInplace(size));
return true;
}
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index dce48a3..4b2063e 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -358,7 +358,7 @@
}
void TextLayoutShaper::init() {
- mDefaultTypeface = SkFontHost::CreateTypeface(NULL, NULL, NULL, 0, SkTypeface::kNormal);
+ mDefaultTypeface = SkFontHost::CreateTypeface(NULL, NULL, SkTypeface::kNormal);
}
void TextLayoutShaper::unrefTypefaces() {
diff --git a/core/jni/android/graphics/Typeface.cpp b/core/jni/android/graphics/Typeface.cpp
index 7f4c37b..e056b61 100644
--- a/core/jni/android/graphics/Typeface.cpp
+++ b/core/jni/android/graphics/Typeface.cpp
@@ -147,25 +147,6 @@
return SkTypeface::CreateFromFile(str.c_str());
}
-#define MIN_GAMMA (0.1f)
-#define MAX_GAMMA (10.0f)
-static float pinGamma(float gamma) {
- if (gamma < MIN_GAMMA) {
- gamma = MIN_GAMMA;
- } else if (gamma > MAX_GAMMA) {
- gamma = MAX_GAMMA;
- }
- return gamma;
-}
-
-extern void skia_set_text_gamma(float, float);
-
-static void Typeface_setGammaForText(JNIEnv* env, jobject, jfloat blackGamma,
- jfloat whiteGamma) {
- // Comment this out for release builds. This is only used during development
- skia_set_text_gamma(pinGamma(blackGamma), pinGamma(whiteGamma));
-}
-
///////////////////////////////////////////////////////////////////////////////
static JNINativeMethod gTypefaceMethods[] = {
@@ -177,7 +158,6 @@
(void*)Typeface_createFromAsset },
{ "nativeCreateFromFile", "(Ljava/lang/String;)I",
(void*)Typeface_createFromFile },
- { "setGammaForText", "(FF)V", (void*)Typeface_setGammaForText },
};
int register_android_graphics_Typeface(JNIEnv* env)
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index d8d55b2..bbda2cf 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -258,8 +258,7 @@
// ----------------------------------------------------------------------------
static bool android_view_GLES20Canvas_quickReject(JNIEnv* env, jobject clazz,
- OpenGLRenderer* renderer, jfloat left, jfloat top, jfloat right, jfloat bottom,
- SkCanvas::EdgeType edge) {
+ OpenGLRenderer* renderer, jfloat left, jfloat top, jfloat right, jfloat bottom) {
return renderer->quickReject(left, top, right, bottom);
}
@@ -934,7 +933,7 @@
{ "nSaveLayerAlpha", "(IFFFFII)I", (void*) android_view_GLES20Canvas_saveLayerAlpha },
{ "nSaveLayerAlpha", "(III)I", (void*) android_view_GLES20Canvas_saveLayerAlphaClip },
- { "nQuickReject", "(IFFFFI)Z", (void*) android_view_GLES20Canvas_quickReject },
+ { "nQuickReject", "(IFFFF)Z", (void*) android_view_GLES20Canvas_quickReject },
{ "nClipRect", "(IFFFFI)Z", (void*) android_view_GLES20Canvas_clipRectF },
{ "nClipRect", "(IIIIII)Z", (void*) android_view_GLES20Canvas_clipRect },
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index 1f15370..bef751b 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -135,6 +135,7 @@
return mScreenshot.getFormat();
}
+ SK_DECLARE_UNFLATTENABLE_OBJECT()
protected:
// overrides from SkPixelRef
virtual void* onLockPixels(SkColorTable** ct) {
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index 3949afd..d8cac41 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -706,7 +706,7 @@
* does not intersect with the canvas' clip
*/
public boolean quickReject(RectF rect, EdgeType type) {
- return native_quickReject(mNativeCanvas, rect, type.nativeInt);
+ return native_quickReject(mNativeCanvas, rect);
}
/**
@@ -726,7 +726,7 @@
* does not intersect with the canvas' clip
*/
public boolean quickReject(Path path, EdgeType type) {
- return native_quickReject(mNativeCanvas, path.ni(), type.nativeInt);
+ return native_quickReject(mNativeCanvas, path.ni());
}
/**
@@ -749,9 +749,9 @@
* @return true if the rect (transformed by the canvas' matrix)
* does not intersect with the canvas' clip
*/
- public boolean quickReject(float left, float top, float right, float bottom, EdgeType type) {
- return native_quickReject(mNativeCanvas, left, top, right, bottom,
- type.nativeInt);
+ public boolean quickReject(float left, float top, float right, float bottom,
+ EdgeType type) {
+ return native_quickReject(mNativeCanvas, left, top, right, bottom);
}
/**
@@ -1656,15 +1656,12 @@
Rect bounds);
private static native void native_getCTM(int canvas, int matrix);
private static native boolean native_quickReject(int nativeCanvas,
- RectF rect,
- int native_edgeType);
+ RectF rect);
private static native boolean native_quickReject(int nativeCanvas,
- int path,
- int native_edgeType);
+ int path);
private static native boolean native_quickReject(int nativeCanvas,
float left, float top,
- float right, float bottom,
- int native_edgeType);
+ float right, float bottom);
private static native void native_drawRGB(int nativeCanvas, int r, int g,
int b);
private static native void native_drawARGB(int nativeCanvas, int a, int r,
diff --git a/graphics/java/android/graphics/Typeface.java b/graphics/java/android/graphics/Typeface.java
index 4487a3c..c68c9f7 100644
--- a/graphics/java/android/graphics/Typeface.java
+++ b/graphics/java/android/graphics/Typeface.java
@@ -225,16 +225,4 @@
private static native int nativeGetStyle(int native_instance);
private static native int nativeCreateFromAsset(AssetManager mgr, String path);
private static native int nativeCreateFromFile(String path);
-
- /**
- * Set the global gamma coefficients for black and white text. This call is
- * usually a no-op in shipping products, and only exists for testing during
- * development.
- *
- * @param blackGamma gamma coefficient for black text
- * @param whiteGamma gamma coefficient for white text
- *
- * @hide - this is just for calibrating devices, not for normal apps
- */
- public static native void setGammaForText(float blackGamma, float whiteGamma);
}
diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk
index 549edd2..67359ad 100644
--- a/libs/hwui/Android.mk
+++ b/libs/hwui/Android.mk
@@ -42,6 +42,7 @@
external/skia/include/core \
external/skia/include/effects \
external/skia/include/images \
+ external/skia/src/core \
external/skia/src/ports \
external/skia/include/utils
diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h
index e42def5..c1f978d 100644
--- a/libs/hwui/DisplayListRenderer.h
+++ b/libs/hwui/DisplayListRenderer.h
@@ -18,7 +18,8 @@
#define ANDROID_HWUI_DISPLAY_LIST_RENDERER_H
#include <SkChunkAlloc.h>
-#include <SkFlattenable.h>
+#include <SkReader32.h>
+#include <SkWriter32.h>
#include <SkMatrix.h>
#include <SkCamera.h>
#include <SkPaint.h>
@@ -499,7 +500,7 @@
Vector<SkiaShader*> mShaders;
Vector<Layer*> mLayers;
- mutable SkFlattenableReadBuffer mReader;
+ mutable SkReader32 mReader;
size_t mSize;
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 47784a4..2a09ced 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -16,6 +16,7 @@
#define LOG_TAG "OpenGLRenderer"
+#include <SkGlyph.h>
#include <SkUtils.h>
#include <cutils/properties.h>
diff --git a/libs/hwui/Layer.h b/libs/hwui/Layer.h
index 181eb6c..efb9f6b8 100644
--- a/libs/hwui/Layer.h
+++ b/libs/hwui/Layer.h
@@ -23,6 +23,7 @@
#include <ui/Region.h>
+#include <SkPaint.h>
#include <SkXfermode.h>
#include "Rect.h"
diff --git a/libs/hwui/font/CacheTexture.cpp b/libs/hwui/font/CacheTexture.cpp
index f653592..24b0523 100644
--- a/libs/hwui/font/CacheTexture.cpp
+++ b/libs/hwui/font/CacheTexture.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <SkGlyph.h>
#include <utils/Log.h>
#include "Debug.h"
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp
index 7bfa63d..9068b8a 100644
--- a/libs/hwui/font/Font.cpp
+++ b/libs/hwui/font/Font.cpp
@@ -18,6 +18,7 @@
#include <cutils/compiler.h>
+#include <SkGlyph.h>
#include <SkUtils.h>
#include "Debug.h"
diff --git a/media/tests/omxjpegdecoder/SkOmxPixelRef.h b/media/tests/omxjpegdecoder/SkOmxPixelRef.h
index afedcbd..374604c 100644
--- a/media/tests/omxjpegdecoder/SkOmxPixelRef.h
+++ b/media/tests/omxjpegdecoder/SkOmxPixelRef.h
@@ -33,6 +33,7 @@
//! Return the allocation size for the pixels
size_t getSize() const { return mSize; }
+ SK_DECLARE_UNFLATTENABLE_OBJECT()
protected:
// overrides from SkPixelRef
virtual void* onLockPixels(SkColorTable**);
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index fff1aa0..c454bb1 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -157,14 +157,14 @@
<string name="accessibility_quick_settings_alarm" msgid="3959908972897295660">"Alarm ustawiony na <xliff:g id="TIME">%s</xliff:g>."</string>
<string name="data_usage_disabled_dialog_3g_title" msgid="5257833881698644687">"Wyłączono transmisję danych 2G/3G"</string>
<string name="data_usage_disabled_dialog_4g_title" msgid="4789143363492682629">"Wyłączono transmisję danych 4G"</string>
- <string name="data_usage_disabled_dialog_mobile_title" msgid="1046047248844821202">"Transmisja danych została wyłączona"</string>
+ <string name="data_usage_disabled_dialog_mobile_title" msgid="1046047248844821202">"Wyłączono komórkową transmisję danych"</string>
<string name="data_usage_disabled_dialog_title" msgid="2086815304858964954">"Wyłączono transmisję danych"</string>
- <string name="data_usage_disabled_dialog" msgid="3853117269051806280">"Ustawiony limit transmisji danych został osiągnięty."\n\n"Jeśli ponownie włączysz przesyłanie danych, operator może naliczyć dodatkowe opłaty."</string>
+ <string name="data_usage_disabled_dialog" msgid="3853117269051806280">"Osiągnięto określony limit wykorzystania transmisji danych."\n\n"Jeśli ponownie włączysz przesyłanie danych, operator może naliczyć opłaty."</string>
<string name="data_usage_disabled_dialog_enable" msgid="7729772039208664606">"Włącz transmisję danych"</string>
<string name="status_bar_settings_signal_meter_disconnected" msgid="1940231521274147771">"Brak internetu"</string>
<string name="status_bar_settings_signal_meter_wifi_nossid" msgid="6557486452774597820">"Wi-Fi: połączono"</string>
<string name="gps_notification_searching_text" msgid="8574247005642736060">"Wyszukiwanie sygnału GPS"</string>
- <string name="gps_notification_found_text" msgid="4619274244146446464">"Lokalizacja z GPSa"</string>
+ <string name="gps_notification_found_text" msgid="4619274244146446464">"Lokalizacja ustawiona według GPS"</string>
<string name="accessibility_clear_all" msgid="5235938559247164925">"Usuń wszystkie powiadomienia."</string>
<string name="status_bar_notification_inspect_item_title" msgid="1163547729015390250">"O aplikacji"</string>
<string name="close_universe" msgid="3736513750241754348">"Zamknij"</string>
diff --git a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
index 2414d70..8701cc8 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
@@ -188,11 +188,6 @@
return delegate.mStyle;
}
- @LayoutlibDelegate
- /*package*/ static void setGammaForText(float blackGamma, float whiteGamma) {
- // This is for device testing only: pass
- }
-
// ---- Private delegate/helper methods ----
private Typeface_Delegate(String family, int style) {