summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2011-01-10 14:10:36 -0800
committerAlex Ray <aray@google.com>2013-07-30 13:56:55 -0700
commitb90c51a7258966c0372a84ec2059fd1b03e2a782 (patch)
tree3906130b5809beae00c3bf04d565346a16cca153
parent0e05bd908d19a863333ec88f9c38b78181e81781 (diff)
downloadsystem_core-b90c51a7258966c0372a84ec2059fd1b03e2a782.tar.gz
system_core-b90c51a7258966c0372a84ec2059fd1b03e2a782.tar.bz2
system_core-b90c51a7258966c0372a84ec2059fd1b03e2a782.zip
Use optimized display lists for all hwaccelerated rendering
Previously, display lists were used only if hardware acceleration was enabled for an application (hardwareAccelerated=true) *and* if setDrawingCacheEnabled(true) was called. This change makes the framework use display lists for all views in an application if hardware acceleration is enabled. In addition, display list renderering has been optimized so that any view's recreation of its own display list (which is necessary whenever the visuals of that view change) will not cause any other display list in its parent hierarchy to change. Instead, when there are any visual changes in the hierarchy, only those views which need to have new display list content will recreate their display lists. This optimization works by caching display list references in each parent display list (so the container of some child will refer to its child's display list by a reference to the child's display list). Then when a view needs to recreate its display list, it will do so inside the same display list object. This will cause the content to get refreshed, but not the reference to that content. Then when the view hierarchy is redrawn, it will automatically pick up the new content from the old reference. This optimization will not necessarily improve performance when applications need to update the entire view hierarchy or redraw the entire screen, but it does show significant improvements when redrawing only a portion of the screen, especially when the regions that are not refreshed are complex and time- consuming to redraw. Change-Id: I68d21cac6a224a05703070ec85253220cb001eb4
-rw-r--r--include/utils/Functor.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/utils/Functor.h b/include/utils/Functor.h
new file mode 100644
index 000000000..3955bc346
--- /dev/null
+++ b/include/utils/Functor.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_FUNCTOR_H
+#define ANDROID_FUNCTOR_H
+
+#include <utils/Errors.h>
+
+namespace android {
+
+class Functor {
+public:
+ Functor() {}
+ virtual ~Functor() {}
+ virtual status_t operator ()() { return true; }
+};
+
+}; // namespace android
+
+#endif // ANDROID_FUNCTOR_H