Fixup from merge, and compile fix due to different skia version
Change-Id: I644c5148904893a2854207f4d566395d973d4aff
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index b20b57a..3772d18 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -54,6 +54,7 @@
jfieldID mNativeObject;
jfieldID mGenerationId;
jfieldID mCanvas;
+ jfieldID mCanvasSaveCount;
jmethodID ctor;
} gSurfaceClassInfo;
@@ -74,78 +75,6 @@
jfieldID mNativeCanvas;
} gCanvasFinalizerClassInfo;
-static struct {
- jfieldID width;
- jfieldID height;
- jfieldID refreshRate;
- jfieldID density;
- jfieldID xDpi;
- jfieldID yDpi;
- jfieldID secure;
-} gPhysicalDisplayInfoClassInfo;
-
-
-class ScreenshotPixelRef : public SkPixelRef {
-public:
- ScreenshotPixelRef(SkColorTable* ctable) {
- fCTable = ctable;
- SkSafeRef(ctable);
- setImmutable();
- }
-
- virtual ~ScreenshotPixelRef() {
- SkSafeUnref(fCTable);
- }
-
- status_t update(const sp<IBinder>& display, int width, int height,
- int minLayer, int maxLayer, bool allLayers) {
- status_t res = (width > 0 && height > 0)
- ? (allLayers
- ? mScreenshot.update(display, width, height)
- : mScreenshot.update(display, width, height, minLayer, maxLayer))
- : mScreenshot.update(display);
- if (res != NO_ERROR) {
- return res;
- }
-
- return NO_ERROR;
- }
-
- uint32_t getWidth() const {
- return mScreenshot.getWidth();
- }
-
- uint32_t getHeight() const {
- return mScreenshot.getHeight();
- }
-
- uint32_t getStride() const {
- return mScreenshot.getStride();
- }
-
- uint32_t getFormat() const {
- return mScreenshot.getFormat();
- }
-
- SK_DECLARE_UNFLATTENABLE_OBJECT()
-protected:
- // overrides from SkPixelRef
- virtual void* onLockPixels(SkColorTable** ct) {
- *ct = fCTable;
- return (void*)mScreenshot.getPixels();
- }
-
- virtual void onUnlockPixels() {
- }
-
-private:
- ScreenshotClient mScreenshot;
- SkColorTable* fCTable;
-
- typedef SkPixelRef INHERITED;
-};
-
-
// ----------------------------------------------------------------------------
bool android_view_Surface_isInstanceOf(JNIEnv* env, jobject obj) {
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index 7398895..1587830 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -110,6 +110,7 @@
virtual void onUnlockPixels() {
}
+ SK_DECLARE_UNFLATTENABLE_OBJECT()
private:
ScreenshotClient mScreenshot;
SkColorTable* fCTable;