summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_android.c
diff options
context:
space:
mode:
authorWuZhen <wuzhen@jidemail.com>2016-06-02 16:21:51 +0800
committerMauro Rossi <issor.oruam@gmail.com>2016-11-01 20:41:59 +0100
commit8f951a6f82fafc09d133c89306c8402f38d6d576 (patch)
tree7218a2c262daa003f737e990a71c46940c43776b /src/egl/drivers/dri2/platform_android.c
parentec4cff949016ec408cf2a203cc7016b3af720ad1 (diff)
downloadexternal_mesa3d-8f951a6f82fafc09d133c89306c8402f38d6d576.zip
external_mesa3d-8f951a6f82fafc09d133c89306c8402f38d6d576.tar.gz
external_mesa3d-8f951a6f82fafc09d133c89306c8402f38d6d576.tar.bz2
android: add a fast path for swrast
Observed increased antutu score on 1024x768, should see more with larger resolution NO_REF_TASK Tested: local run Change-Id: Ia05e0551a65ae7678561b167c1f5e75509ea4e84
Diffstat (limited to 'src/egl/drivers/dri2/platform_android.c')
-rw-r--r--src/egl/drivers/dri2/platform_android.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 3c14086..d248ed2 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -882,10 +882,14 @@ swrastPutImage2(__DRIdrawable * draw, int op,
dstPtr += y * dstStride + xOffset;
srcPtr = data;
- for (; h>0; h--) {
- memcpy(dstPtr, srcPtr, copyWidth);
- srcPtr += stride;
- dstPtr += dstStride;
+ if (xOffset == 0 && copyWidth == stride && copyWidth == dstStride) {
+ memcpy(dstPtr, srcPtr, copyWidth * h);
+ } else {
+ for (; h>0; h--) {
+ memcpy(dstPtr, srcPtr, copyWidth);
+ srcPtr += stride;
+ dstPtr += dstStride;
+ }
}
if (gr_module->unlock(gr_module, dri2_surf->buffer->handle)) {
@@ -942,10 +946,14 @@ swrastGetImage(__DRIdrawable * read,
srcPtr += y * srcStride + xOffset;
dstPtr = data;
- for (; h>0; h--) {
- memcpy(dstPtr, srcPtr, copyWidth);
- srcPtr += srcStride;
- dstPtr += copyWidth;
+ if (xOffset == 0 && copyWidth == srcStride) {
+ memcpy(dstPtr, srcPtr, copyWidth * h);
+ } else {
+ for (; h>0; h--) {
+ memcpy(dstPtr, srcPtr, copyWidth);
+ srcPtr += srcStride;
+ dstPtr += copyWidth;
+ }
}
if (gr_module->unlock(gr_module, dri2_surf->buffer->handle)) {