diff options
| -rw-r--r-- | api/current.xml | 39 | ||||
| -rw-r--r-- | core/java/android/animation/PropertyValuesHolder.java | 4 | ||||
| -rw-r--r-- | core/java/android/view/View.java | 55 | ||||
| -rw-r--r-- | core/java/android/webkit/WebSettings.java | 9 | ||||
| -rw-r--r-- | core/java/android/webkit/ZoomManager.java | 10 | ||||
| -rw-r--r-- | core/res/res/values/dimens.xml | 2 | ||||
| -rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 12 | ||||
| -rw-r--r-- | libs/hwui/Snapshot.h | 1 | ||||
| -rw-r--r-- | services/java/com/android/server/WindowManagerService.java | 15 |
9 files changed, 32 insertions, 115 deletions
diff --git a/api/current.xml b/api/current.xml index 5f0824929881..6677a90f9f20 100644 --- a/api/current.xml +++ b/api/current.xml @@ -204443,19 +204443,6 @@ <parameter name="canvas" type="android.graphics.Canvas"> </parameter> </method> -<method name="onDrawDragThumbnail" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="protected" -> -<parameter name="canvas" type="android.graphics.Canvas"> -</parameter> -</method> <method name="onDrawScrollBars" return="void" abstract="false" @@ -204649,17 +204636,6 @@ <parameter name="heightMeasureSpec" type="int"> </parameter> </method> -<method name="onMeasureDragThumbnail" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="protected" -> -</method> <method name="onRestoreInstanceState" return="void" abstract="false" @@ -205325,21 +205301,6 @@ <parameter name="contentDescription" type="java.lang.CharSequence"> </parameter> </method> -<method name="setDragThumbnailDimension" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="true" - deprecated="not deprecated" - visibility="protected" -> -<parameter name="width" type="int"> -</parameter> -<parameter name="height" type="int"> -</parameter> -</method> <method name="setDrawingCacheBackgroundColor" return="void" abstract="false" diff --git a/core/java/android/animation/PropertyValuesHolder.java b/core/java/android/animation/PropertyValuesHolder.java index da7c29bd6bf4..0f759f1aa164 100644 --- a/core/java/android/animation/PropertyValuesHolder.java +++ b/core/java/android/animation/PropertyValuesHolder.java @@ -135,7 +135,6 @@ public class PropertyValuesHolder implements Cloneable { public static PropertyValuesHolder ofInt(String propertyName, int... values) { PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName); pvh.setIntValues(values); - Log.v("PVH", "ofFloat: propertyName: " + pvh.mPropertyName); return pvh; } @@ -149,7 +148,6 @@ public class PropertyValuesHolder implements Cloneable { public static PropertyValuesHolder ofFloat(String propertyName, float... values) { PropertyValuesHolder pvh = new PropertyValuesHolder(propertyName); pvh.setFloatValues(values); - Log.v("PVH", "ofFloat: propertyName: " + pvh.mPropertyName); return pvh; } @@ -352,8 +350,6 @@ public class PropertyValuesHolder implements Cloneable { */ private Method getPropertyFunction(Class targetClass, String prefix, Class valueType) { // TODO: faster implementation... - Log.v("PVH", "getPropertyFunction: class, prefix, valueType, propertyName: " + - targetClass + ", " + prefix + ", " + valueType + ", "+ mPropertyName); Method returnVal = null; String firstLetter = mPropertyName.substring(0, 1); String theRest = mPropertyName.substring(1); diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 7ee360d59268..8e4591aac047 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -2037,8 +2037,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * */ boolean mCanAcceptDrop; - private int mThumbnailWidth; - private int mThumbnailHeight; /** * Simple constructor to use when creating a view from code. @@ -9921,10 +9919,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility throw new IllegalStateException("Drag thumb dimensions must not be negative"); } + if (ViewDebug.DEBUG_DRAG) { + Log.d(VIEW_LOG_TAG, "drag thumb: width=" + thumbSize.x + " height=" + thumbSize.y + + " thumbX=" + thumbTouchPoint.x + " thumbY=" + thumbTouchPoint.y); + } Surface surface = new Surface(); try { IBinder token = mAttachInfo.mSession.prepareDrag(mAttachInfo.mWindow, - myWindowOnly, mThumbnailWidth, mThumbnailHeight, surface); + myWindowOnly, thumbSize.x, thumbSize.y, surface); if (ViewDebug.DEBUG_DRAG) Log.d(VIEW_LOG_TAG, "prepareDrag returned token=" + token + " surface=" + surface); if (token != null) { @@ -9951,53 +9953,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility return okay; } - private void measureThumbnail() { - mPrivateFlags &= ~MEASURED_DIMENSION_SET; - - onMeasureDragThumbnail(); - - // flag not set, setDragThumbnailDimension() was not invoked, we raise - // an exception to warn the developer - if ((mPrivateFlags & MEASURED_DIMENSION_SET) != MEASURED_DIMENSION_SET) { - throw new IllegalStateException("onMeasureDragThumbnail() did not set the" - + " measured dimension by calling setDragThumbnailDimension()"); - } - - if (ViewDebug.DEBUG_DRAG) { - Log.d(VIEW_LOG_TAG, "Drag thumb measured: w=" + mThumbnailWidth - + " h=" + mThumbnailHeight); - } - } - - /** - * The View must call this method from onMeasureDragThumbnail() in order to - * specify the dimensions of the drag thumbnail image. - * - * @param width The desired thumbnail width. - * @param height The desired thumbnail height. - */ - protected final void setDragThumbnailDimension(int width, int height) { - mPrivateFlags |= MEASURED_DIMENSION_SET; - mThumbnailWidth = width; - mThumbnailHeight = height; - } - - /** - * The default implementation specifies a drag thumbnail that matches the - * View's current size and appearance. - */ - protected void onMeasureDragThumbnail() { - setDragThumbnailDimension(getWidth(), getHeight()); - } - - /** - * The default implementation just draws the current View appearance as the thumbnail - * @param canvas - */ - protected void onDrawDragThumbnail(Canvas canvas) { - draw(canvas); - } - /** * Drag-and-drop event dispatch. The event.getAction() verb is one of the DragEvent * constants DRAG_STARTED_EVENT, DRAG_EVENT, DROP_EVENT, and DRAG_ENDED_EVENT. diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java index 4689740b869c..1dd2e8f4f0c3 100644 --- a/core/java/android/webkit/WebSettings.java +++ b/core/java/android/webkit/WebSettings.java @@ -179,7 +179,6 @@ public class WebSettings { private boolean mUseDoubleTree = false; private boolean mUseWideViewport = false; private boolean mUseFixedViewport = false; - private int mMaxFixedViewportWidth = WebView.DEFAULT_VIEWPORT_WIDTH; private boolean mSupportMultipleWindows = false; private boolean mShrinksStandaloneImagesToFit = false; private long mMaximumDecodedImageSize = 0; // 0 means default @@ -378,7 +377,6 @@ public class WebSettings { final int minTabletWidth = context.getResources().getDimensionPixelSize( com.android.internal.R.dimen.min_xlarge_screen_width); mUseFixedViewport = (metrics.density == 1.0f && landscapeWidth >= minTabletWidth); - mMaxFixedViewportWidth = (int) (landscapeWidth * 1.25); if (sLockForLocaleSettings == null) { sLockForLocaleSettings = new Object(); @@ -1570,13 +1568,6 @@ public class WebSettings { } /** - * Returns maximum fixed viewport width. - */ - /* package */ int getMaxFixedViewportWidth() { - return mMaxFixedViewportWidth; - } - - /** * Returns whether private browsing is enabled. */ /* package */ boolean isPrivateBrowsingEnabled() { diff --git a/core/java/android/webkit/ZoomManager.java b/core/java/android/webkit/ZoomManager.java index d81f4764c987..b0a96be9987d 100644 --- a/core/java/android/webkit/ZoomManager.java +++ b/core/java/android/webkit/ZoomManager.java @@ -830,20 +830,26 @@ class ZoomManager { WebViewCore.ViewState viewState = drawData.mViewState; final Point viewSize = drawData.mViewPoint; updateZoomRange(viewState, viewSize.x, drawData.mMinPrefWidth); + if (mWebView.getSettings().getUseWideViewPort() && + mWebView.getSettings().getUseFixedViewport()) { + final int contentWidth = drawData.mWidthHeight.x; + setZoomOverviewWidth(Math.min(WebView.sMaxViewportWidth, contentWidth)); + } if (!mWebView.drawHistory()) { final float scale; final boolean reflowText; + WebSettings settings = mWebView.getSettings(); if (mInitialScale > 0) { scale = mInitialScale; reflowText = exceedsMinScaleIncrement(mTextWrapScale, scale); - } else if (viewState.mViewScale > 0) { + } else if (viewState.mViewScale > 0 && + (viewState.mMobileSite || !settings.getUseFixedViewport())) { mTextWrapScale = viewState.mTextWrapScale; scale = viewState.mViewScale; reflowText = false; } else { - WebSettings settings = mWebView.getSettings(); if (settings.getUseWideViewPort() && (settings.getLoadWithOverviewMode() || settings.getUseFixedViewport())) { mInitialZoomOverview = true; diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index 6ec80174b3ac..0928ce051279 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -46,8 +46,6 @@ <dimen name="fastscroll_thumb_height">52dp</dimen> <!-- Min width for a tablet device --> <dimen name="min_xlarge_screen_width">800dp</dimen> - <!-- Fixed viewport margin for website content width change --> - <dimen name="fixed_viewport_margin">7dp</dimen> <!-- Default height of a key in the password keyboard for alpha --> <dimen name="password_keyboard_key_height_alpha">56dip</dimen> <!-- Default height of a key in the password keyboard for numeric --> diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 287601092f20..81fa1ea521b2 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -388,7 +388,8 @@ bool OpenGLRenderer::createLayer(sp<Snapshot> snapshot, float left, float top, snapshot->invisible = true; } else { // TODO: Should take the mode into account - snapshot->invisible = snapshot->previous->invisible || alpha <= ALPHA_THRESHOLD; + snapshot->invisible = snapshot->previous->invisible || + (alpha <= ALPHA_THRESHOLD && fboLayer); } // Bail out if we won't draw in this snapshot @@ -551,7 +552,7 @@ void OpenGLRenderer::clearLayerRegions() { Rect* bounds = mLayers.itemAt(i); // Clear the framebuffer where the layer will draw - glScissor(bounds->left, mHeight - bounds->bottom, + glScissor(bounds->left, mSnapshot->height - bounds->bottom, bounds->getWidth(), bounds->getHeight()); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); @@ -620,7 +621,12 @@ bool OpenGLRenderer::quickReject(float left, float top, float right, float botto Rect r(left, top, right, bottom); mSnapshot->transform->mapRect(r); - return !mSnapshot->clipRect->intersects(r); + r.snapToPixelBoundaries(); + + Rect clipRect(*mSnapshot->clipRect); + clipRect.snapToPixelBoundaries(); + + return !clipRect.intersects(r); } bool OpenGLRenderer::clipRect(float left, float top, float right, float bottom, SkRegion::Op op) { diff --git a/libs/hwui/Snapshot.h b/libs/hwui/Snapshot.h index 35cdf6f23395..2da195016c3a 100644 --- a/libs/hwui/Snapshot.h +++ b/libs/hwui/Snapshot.h @@ -152,7 +152,6 @@ public: } if (clipped) { - clipRect->snapToPixelBoundaries(); flags |= Snapshot::kFlagClipSet | Snapshot::kFlagDirtyLocalClip; } diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index 6c23e3765421..def36de4f22b 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -555,6 +555,12 @@ public class WindowManagerService extends IWindowManager.Stub } } + int getDragLayerLw() { + return mPolicy.windowTypeToLayerLw(WindowManager.LayoutParams.TYPE_DRAG) + * TYPE_LAYER_MULTIPLIER + + TYPE_LAYER_OFFSET; + } + /* call out to each visible window/session informing it about the drag */ void broadcastDragStartedLw(final float touchX, final float touchY) { @@ -5533,7 +5539,7 @@ public class WindowManagerService extends IWindowManager.Stub return null; } - private void addDragInputWindow(InputWindowList windowList) { + private void addDragInputWindowLw(InputWindowList windowList) { final InputWindow inputWindow = windowList.add(); inputWindow.inputChannel = mDragState.mServerChannel; inputWindow.name = "drag"; @@ -5545,9 +5551,7 @@ public class WindowManagerService extends IWindowManager.Stub inputWindow.hasFocus = true; inputWindow.hasWallpaper = false; inputWindow.paused = false; - inputWindow.layer = mPolicy.windowTypeToLayerLw(inputWindow.layoutParamsType) - * TYPE_LAYER_MULTIPLIER - + TYPE_LAYER_OFFSET; + inputWindow.layer = mDragState.getDragLayerLw(); inputWindow.ownerPid = Process.myPid(); inputWindow.ownerUid = Process.myUid(); @@ -5583,7 +5587,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_DRAG) { Log.d(TAG, "Inserting drag window"); } - addDragInputWindow(mTempInputWindows); + addDragInputWindowLw(mTempInputWindows); } final int N = windows.size(); @@ -6231,6 +6235,7 @@ public class WindowManagerService extends IWindowManager.Stub surface.setPosition((int)(touchX - thumbCenterX), (int)(touchY - thumbCenterY)); surface.setAlpha(.5f); + surface.setLayer(mDragState.getDragLayerLw()); surface.show(); } finally { surface.closeTransaction(); |