Loading core/java/android/view/View.java +8 −8 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package android.view; import com.android.internal.R; import com.android.internal.view.menu.MenuBuilder; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; Loading Loading @@ -49,8 +46,6 @@ import android.os.RemoteException; import android.os.SystemClock; import android.os.SystemProperties; import android.util.AttributeSet; import android.util.Config; import android.util.EventLog; import android.util.Log; import android.util.Pool; import android.util.Poolable; Loading @@ -67,6 +62,8 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; import android.widget.ScrollBarDrawable; import com.android.internal.R; import com.android.internal.view.menu.MenuBuilder; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; Loading Loading @@ -4022,12 +4019,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility */ public boolean dispatchKeyEvent(KeyEvent event) { // If any attached key listener a first crack at the event. //noinspection SimplifiableIfStatement //noinspection SimplifiableIfStatement,deprecation if (android.util.Config.LOGV) { captureViewInfo("captureViewKeyEvent", this); } //noinspection SimplifiableIfStatement if (mOnKeyListener != null && (mViewFlags & ENABLED_MASK) == ENABLED && mOnKeyListener.onKey(this, event.getKeyCode(), event)) { return true; Loading Loading @@ -4059,6 +4057,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility return false; } //noinspection SimplifiableIfStatement if (mOnTouchListener != null && (mViewFlags & ENABLED_MASK) == ENABLED && mOnTouchListener.onTouch(this, event)) { return true; Loading @@ -4075,6 +4074,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * @see #getFilterTouchesWhenObscured */ public boolean onFilterTouchEventForSecurity(MotionEvent event) { //noinspection RedundantIfStatement if ((mViewFlags & FILTER_TOUCHES_WHEN_OBSCURED) != 0 && (event.getFlags() & MotionEvent.FLAG_WINDOW_IS_OBSCURED) != 0) { // Window is obscured, drop this touch. Loading Loading @@ -7829,8 +7829,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility saveCount = canvas.getSaveCount(); int solidColor = getSolidColor(); // TODO: Temporarily disable fading edges with hardware acceleration if (solidColor == 0 && !canvas.isHardwareAccelerated()) { if (solidColor == 0) { final int flags = Canvas.HAS_ALPHA_LAYER_SAVE_FLAG; if (drawTop) { Loading Loading @@ -9577,6 +9576,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility if (mAttachInfo == null) { return false; } //noinspection SimplifiableIfStatement if ((flags & HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING) == 0 && !isHapticFeedbackEnabled()) { return false; Loading core/res/res/drawable-xlarge/default_wallpaper.jpg −805 KiB (112 KiB) Loading image diff... libs/hwui/Layer.h +2 −11 Original line number Diff line number Diff line Loading @@ -63,28 +63,19 @@ struct LayerSize { */ struct Layer { /** * Coordinates of the layer corresponding to this snapshot. * Only set when the flag kFlagIsLayer is set. * Coordinates of the layer. */ Rect layer; /** * Name of the texture used to render the layer. * Only set when the flag kFlagIsLayer is set. */ GLuint texture; /** * Name of the FBO used to render the layer. * Only set when the flag kFlagIsLayer is set. */ GLuint fbo; /** * Opacity of the layer. * Only set when the flag kFlagIsLayer is set. */ float alpha; int alpha; /** * Blending mode of the layer. * Only set when the flag kFlagIsLayer is set. */ SkXfermode::Mode mode; /** Loading libs/hwui/LayerCache.cpp +1 −23 Original line number Diff line number Diff line Loading @@ -87,7 +87,6 @@ void LayerCache::deleteLayer(Layer* layer) { if (layer) { mSize -= layer->layer.getWidth() * layer->layer.getHeight() * 4; glDeleteFramebuffers(1, &layer->fbo); glDeleteTextures(1, &layer->texture); delete layer; } Loading @@ -99,7 +98,7 @@ void LayerCache::clear() { mCache.setOnEntryRemovedListener(NULL); } Layer* LayerCache::get(LayerSize& size, GLuint previousFbo) { Layer* LayerCache::get(LayerSize& size) { Layer* layer = mCache.remove(size); if (layer) { LAYER_LOGD("Reusing layer"); Loading @@ -111,10 +110,6 @@ Layer* LayerCache::get(LayerSize& size, GLuint previousFbo) { layer = new Layer; layer->blend = true; // Generate the FBO and attach the texture glGenFramebuffers(1, &layer->fbo); glBindFramebuffer(GL_FRAMEBUFFER, layer->fbo); // Generate the texture in which the FBO will draw glGenTextures(1, &layer->texture); glBindTexture(GL_TEXTURE_2D, layer->texture); Loading @@ -128,23 +123,6 @@ Layer* LayerCache::get(LayerSize& size, GLuint previousFbo) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size.width, size.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); // Bind texture to FBO glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, layer->texture, 0); GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { LOGE("Framebuffer incomplete (GL error code 0x%x)", status); glBindFramebuffer(GL_FRAMEBUFFER, previousFbo); glDeleteFramebuffers(1, &layer->fbo); glDeleteTextures(1, &layer->texture); delete layer; return NULL; } } return layer; Loading libs/hwui/LayerCache.h +1 −3 Original line number Diff line number Diff line Loading @@ -62,10 +62,8 @@ public: * size of the cache goes down. * * @param size The dimensions of the desired layer * @param previousFbo The name of the FBO to bind to if creating a new * layer fails */ Layer* get(LayerSize& size, GLuint previousFbo); Layer* get(LayerSize& size); /** * Adds the layer to the cache. The layer will not be added if there is * not enough space available. Loading Loading
core/java/android/view/View.java +8 −8 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package android.view; import com.android.internal.R; import com.android.internal.view.menu.MenuBuilder; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; Loading Loading @@ -49,8 +46,6 @@ import android.os.RemoteException; import android.os.SystemClock; import android.os.SystemProperties; import android.util.AttributeSet; import android.util.Config; import android.util.EventLog; import android.util.Log; import android.util.Pool; import android.util.Poolable; Loading @@ -67,6 +62,8 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; import android.widget.ScrollBarDrawable; import com.android.internal.R; import com.android.internal.view.menu.MenuBuilder; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; Loading Loading @@ -4022,12 +4019,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility */ public boolean dispatchKeyEvent(KeyEvent event) { // If any attached key listener a first crack at the event. //noinspection SimplifiableIfStatement //noinspection SimplifiableIfStatement,deprecation if (android.util.Config.LOGV) { captureViewInfo("captureViewKeyEvent", this); } //noinspection SimplifiableIfStatement if (mOnKeyListener != null && (mViewFlags & ENABLED_MASK) == ENABLED && mOnKeyListener.onKey(this, event.getKeyCode(), event)) { return true; Loading Loading @@ -4059,6 +4057,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility return false; } //noinspection SimplifiableIfStatement if (mOnTouchListener != null && (mViewFlags & ENABLED_MASK) == ENABLED && mOnTouchListener.onTouch(this, event)) { return true; Loading @@ -4075,6 +4074,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * @see #getFilterTouchesWhenObscured */ public boolean onFilterTouchEventForSecurity(MotionEvent event) { //noinspection RedundantIfStatement if ((mViewFlags & FILTER_TOUCHES_WHEN_OBSCURED) != 0 && (event.getFlags() & MotionEvent.FLAG_WINDOW_IS_OBSCURED) != 0) { // Window is obscured, drop this touch. Loading Loading @@ -7829,8 +7829,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility saveCount = canvas.getSaveCount(); int solidColor = getSolidColor(); // TODO: Temporarily disable fading edges with hardware acceleration if (solidColor == 0 && !canvas.isHardwareAccelerated()) { if (solidColor == 0) { final int flags = Canvas.HAS_ALPHA_LAYER_SAVE_FLAG; if (drawTop) { Loading Loading @@ -9577,6 +9576,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility if (mAttachInfo == null) { return false; } //noinspection SimplifiableIfStatement if ((flags & HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING) == 0 && !isHapticFeedbackEnabled()) { return false; Loading
libs/hwui/Layer.h +2 −11 Original line number Diff line number Diff line Loading @@ -63,28 +63,19 @@ struct LayerSize { */ struct Layer { /** * Coordinates of the layer corresponding to this snapshot. * Only set when the flag kFlagIsLayer is set. * Coordinates of the layer. */ Rect layer; /** * Name of the texture used to render the layer. * Only set when the flag kFlagIsLayer is set. */ GLuint texture; /** * Name of the FBO used to render the layer. * Only set when the flag kFlagIsLayer is set. */ GLuint fbo; /** * Opacity of the layer. * Only set when the flag kFlagIsLayer is set. */ float alpha; int alpha; /** * Blending mode of the layer. * Only set when the flag kFlagIsLayer is set. */ SkXfermode::Mode mode; /** Loading
libs/hwui/LayerCache.cpp +1 −23 Original line number Diff line number Diff line Loading @@ -87,7 +87,6 @@ void LayerCache::deleteLayer(Layer* layer) { if (layer) { mSize -= layer->layer.getWidth() * layer->layer.getHeight() * 4; glDeleteFramebuffers(1, &layer->fbo); glDeleteTextures(1, &layer->texture); delete layer; } Loading @@ -99,7 +98,7 @@ void LayerCache::clear() { mCache.setOnEntryRemovedListener(NULL); } Layer* LayerCache::get(LayerSize& size, GLuint previousFbo) { Layer* LayerCache::get(LayerSize& size) { Layer* layer = mCache.remove(size); if (layer) { LAYER_LOGD("Reusing layer"); Loading @@ -111,10 +110,6 @@ Layer* LayerCache::get(LayerSize& size, GLuint previousFbo) { layer = new Layer; layer->blend = true; // Generate the FBO and attach the texture glGenFramebuffers(1, &layer->fbo); glBindFramebuffer(GL_FRAMEBUFFER, layer->fbo); // Generate the texture in which the FBO will draw glGenTextures(1, &layer->texture); glBindTexture(GL_TEXTURE_2D, layer->texture); Loading @@ -128,23 +123,6 @@ Layer* LayerCache::get(LayerSize& size, GLuint previousFbo) { glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size.width, size.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); // Bind texture to FBO glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, layer->texture, 0); GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { LOGE("Framebuffer incomplete (GL error code 0x%x)", status); glBindFramebuffer(GL_FRAMEBUFFER, previousFbo); glDeleteFramebuffers(1, &layer->fbo); glDeleteTextures(1, &layer->texture); delete layer; return NULL; } } return layer; Loading
libs/hwui/LayerCache.h +1 −3 Original line number Diff line number Diff line Loading @@ -62,10 +62,8 @@ public: * size of the cache goes down. * * @param size The dimensions of the desired layer * @param previousFbo The name of the FBO to bind to if creating a new * layer fails */ Layer* get(LayerSize& size, GLuint previousFbo); Layer* get(LayerSize& size); /** * Adds the layer to the cache. The layer will not be added if there is * not enough space available. Loading