diff options
author | Svetoslav <svetoslavganov@google.com> | 2014-09-13 18:57:44 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-13 18:57:44 +0000 |
commit | 16c8e53b331d32da486b2f0e010ff6d79f4d0125 (patch) | |
tree | 93ac37b9ea75002795d5b4cb88234f70ccfb51f5 /packages | |
parent | e171af61f503ae8bf5ed513fd2c339fb102b05cb (diff) | |
parent | 2047df6f5f6af14cdb93f220c0329f1bff7a43ff (diff) | |
download | frameworks_base-16c8e53b331d32da486b2f0e010ff6d79f4d0125.zip frameworks_base-16c8e53b331d32da486b2f0e010ff6d79f4d0125.tar.gz frameworks_base-16c8e53b331d32da486b2f0e010ff6d79f4d0125.tar.bz2 |
am c2281007: Merge "Page content sometimes missing while scrolling." into lmp-dev
* commit 'c2281007f190ab197b23484fd087c30955ffdd6b':
Page content sometimes missing while scrolling.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java | 8 | ||||
-rw-r--r-- | packages/PrintSpooler/src/com/android/printspooler/widget/PageContentView.java | 9 |
2 files changed, 3 insertions, 14 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java b/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java index 1d8261b..14c41da 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java +++ b/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java @@ -345,7 +345,7 @@ public final class PageContentRepository { Iterator<Map.Entry<Integer, RenderedPage>> iterator = mRenderedPages.entrySet().iterator(); while (iterator.hasNext()) { - iterator.next().getValue().recycle(); + iterator.next(); iterator.remove(); } } @@ -425,10 +425,6 @@ public final class PageContentRepository { return content.getBitmap().getByteCount(); } - public void recycle() { - content.getBitmap().recycle(); - } - public void erase() { content.getBitmap().eraseColor(Color.WHITE); } @@ -738,7 +734,6 @@ public final class PageContentRepository { + " with different size."); } mPageContentCache.removeRenderedPage(mPageIndex); - mRenderedPage.recycle(); mRenderedPage = null; } @@ -762,7 +757,6 @@ public final class PageContentRepository { Log.i(LOG_TAG, "Recycling bitmap for page: " + mPageIndex + " with different size."); } - renderedPage.recycle(); continue; } diff --git a/packages/PrintSpooler/src/com/android/printspooler/widget/PageContentView.java b/packages/PrintSpooler/src/com/android/printspooler/widget/PageContentView.java index c22c0e2..1000117 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/widget/PageContentView.java +++ b/packages/PrintSpooler/src/com/android/printspooler/widget/PageContentView.java @@ -46,16 +46,12 @@ public class PageContentView extends View private boolean mContentRequested; - private boolean mNeedsLayout; - public PageContentView(Context context, AttributeSet attrs) { super(context, attrs); } @Override - protected void onLayout(boolean changed, int left, int top, int right, int bottom) { - super.onLayout(changed, left, top, right, bottom); - mNeedsLayout = false; + protected void onSizeChanged(int w, int h, int oldw, int oldh) { requestPageContentIfNeeded(); } @@ -91,7 +87,6 @@ public class PageContentView extends View mEmptyState = emptyState; mContentRequested = false; - mNeedsLayout = mNeedsLayout || mediaSizeChanged || marginsChanged; // If there is no provider we want immediately to switch to // the empty state, so pages with no content appear blank. @@ -104,7 +99,7 @@ public class PageContentView extends View private void requestPageContentIfNeeded() { if (getWidth() > 0 && getHeight() > 0 && !mContentRequested - && mProvider != null && !mNeedsLayout) { + && mProvider != null) { mContentRequested = true; mProvider.getPageContent(new RenderSpec(getWidth(), getHeight(), mMediaSize, mMinMargins), this); |