The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 17 | // #define LOG_NDEBUG 0 |
| 18 | #undef LOG_TAG |
| 19 | #define LOG_TAG "DisplayDevice" |
| 20 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 21 | #include <stdlib.h> |
| 22 | #include <stdio.h> |
| 23 | #include <string.h> |
| 24 | #include <math.h> |
| 25 | |
| 26 | #include <cutils/properties.h> |
| 27 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 28 | #include <utils/RefBase.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 29 | #include <utils/Log.h> |
| 30 | |
Mathias Agopian | c666cae | 2012-07-25 18:56:13 -0700 | [diff] [blame] | 31 | #include <ui/DisplayInfo.h> |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 32 | #include <ui/PixelFormat.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | |
Mathias Agopian | e3c697f | 2013-02-14 17:11:02 -0800 | [diff] [blame] | 34 | #include <gui/Surface.h> |
Jamie Gennis | 1a4d883 | 2012-08-02 20:11:05 -0700 | [diff] [blame] | 35 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 36 | #include <hardware/gralloc.h> |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 38 | #include "DisplayHardware/DisplaySurface.h" |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 39 | #include "DisplayHardware/HWComposer.h" |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 40 | #ifdef USE_HWC2 |
| 41 | #include "DisplayHardware/HWC2.h" |
| 42 | #endif |
Mathias Agopian | 875d8e1 | 2013-06-07 15:35:48 -0700 | [diff] [blame] | 43 | #include "RenderEngine/RenderEngine.h" |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 44 | |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 45 | #include "clz.h" |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 46 | #include "DisplayDevice.h" |
Mathias Agopian | c7d14e2 | 2011-08-01 16:32:21 -0700 | [diff] [blame] | 47 | #include "SurfaceFlinger.h" |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 48 | #include "Layer.h" |
Mathias Agopian | 1f7bec6 | 2010-06-25 18:02:21 -0700 | [diff] [blame] | 49 | |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 50 | // ---------------------------------------------------------------------------- |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 51 | using namespace android; |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 52 | // ---------------------------------------------------------------------------- |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 54 | #ifdef EGL_ANDROID_swap_rectangle |
| 55 | static constexpr bool kEGLAndroidSwapRectangle = true; |
| 56 | #else |
| 57 | static constexpr bool kEGLAndroidSwapRectangle = false; |
| 58 | #endif |
| 59 | |
| 60 | #if !defined(EGL_EGLEXT_PROTOTYPES) || !defined(EGL_ANDROID_swap_rectangle) |
| 61 | // Dummy implementation in case it is missing. |
| 62 | inline void eglSetSwapRectangleANDROID (EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint) { |
| 63 | } |
| 64 | #endif |
| 65 | |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 66 | /* |
| 67 | * Initialize the display to the specified values. |
| 68 | * |
| 69 | */ |
| 70 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 71 | DisplayDevice::DisplayDevice( |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 72 | const sp<SurfaceFlinger>& flinger, |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 73 | DisplayType type, |
Jesse Hall | ffe1f19 | 2013-03-22 15:13:48 -0700 | [diff] [blame] | 74 | int32_t hwcId, |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 75 | #ifndef USE_HWC2 |
Jesse Hall | 19e8729 | 2013-12-23 21:02:15 -0800 | [diff] [blame] | 76 | int format, |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 77 | #endif |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 78 | bool isSecure, |
| 79 | const wp<IBinder>& displayToken, |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 80 | const sp<DisplaySurface>& displaySurface, |
Mathias Agopian | db89edc | 2013-08-02 01:40:18 -0700 | [diff] [blame] | 81 | const sp<IGraphicBufferProducer>& producer, |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 82 | EGLConfig config) |
Jesse Hall | b7a0549 | 2014-08-14 15:45:06 -0700 | [diff] [blame] | 83 | : lastCompositionHadVisibleLayers(false), |
| 84 | mFlinger(flinger), |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 85 | mType(type), |
| 86 | mHwcDisplayId(hwcId), |
Chih-Wei Huang | 27e2562 | 2013-01-07 17:33:56 +0800 | [diff] [blame] | 87 | mDisplayToken(displayToken), |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 88 | mDisplaySurface(displaySurface), |
Mathias Agopian | 92a979a | 2012-08-02 18:32:23 -0700 | [diff] [blame] | 89 | mDisplay(EGL_NO_DISPLAY), |
| 90 | mSurface(EGL_NO_SURFACE), |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 91 | mDisplayWidth(), |
| 92 | mDisplayHeight(), |
| 93 | #ifndef USE_HWC2 |
| 94 | mFormat(), |
| 95 | #endif |
Mathias Agopian | 92a979a | 2012-08-02 18:32:23 -0700 | [diff] [blame] | 96 | mFlags(), |
| 97 | mPageFlipCount(), |
Jamie Gennis | dd3cb84 | 2012-10-19 18:19:11 -0700 | [diff] [blame] | 98 | mIsSecure(isSecure), |
Jesse Hall | 01e2905 | 2013-02-19 16:13:35 -0800 | [diff] [blame] | 99 | mLayerStack(NO_LAYER_STACK), |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 100 | mOrientation(), |
Michael Lentine | 6c9e34a | 2014-07-14 13:48:55 -0700 | [diff] [blame] | 101 | mPowerMode(HWC_POWER_MODE_OFF), |
| 102 | mActiveConfig(0) |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 103 | { |
james.zhang | 5e8eb5e | 2015-12-01 17:55:11 +0800 | [diff] [blame] | 104 | Surface* surface; |
| 105 | mNativeWindow = surface = new Surface(producer, false); |
Jesse Hall | ffe1f19 | 2013-03-22 15:13:48 -0700 | [diff] [blame] | 106 | ANativeWindow* const window = mNativeWindow.get(); |
| 107 | |
Jesse Hall | ffe1f19 | 2013-03-22 15:13:48 -0700 | [diff] [blame] | 108 | /* |
| 109 | * Create our display's surface |
| 110 | */ |
| 111 | |
james.zhang | 5e8eb5e | 2015-12-01 17:55:11 +0800 | [diff] [blame] | 112 | EGLSurface eglSurface; |
Jesse Hall | ffe1f19 | 2013-03-22 15:13:48 -0700 | [diff] [blame] | 113 | EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); |
Jesse Hall | 19e8729 | 2013-12-23 21:02:15 -0800 | [diff] [blame] | 114 | if (config == EGL_NO_CONFIG) { |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 115 | #ifdef USE_HWC2 |
| 116 | config = RenderEngine::chooseEglConfig(display, PIXEL_FORMAT_RGBA_8888); |
| 117 | #else |
Jesse Hall | 19e8729 | 2013-12-23 21:02:15 -0800 | [diff] [blame] | 118 | config = RenderEngine::chooseEglConfig(display, format); |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 119 | #endif |
Jesse Hall | 19e8729 | 2013-12-23 21:02:15 -0800 | [diff] [blame] | 120 | } |
james.zhang | 5e8eb5e | 2015-12-01 17:55:11 +0800 | [diff] [blame] | 121 | eglSurface = eglCreateWindowSurface(display, config, window, NULL); |
| 122 | eglQuerySurface(display, eglSurface, EGL_WIDTH, &mDisplayWidth); |
| 123 | eglQuerySurface(display, eglSurface, EGL_HEIGHT, &mDisplayHeight); |
Jesse Hall | ffe1f19 | 2013-03-22 15:13:48 -0700 | [diff] [blame] | 124 | |
John Dong | 4ee5696 | 2014-02-21 12:37:59 -0800 | [diff] [blame] | 125 | // Make sure that composition can never be stalled by a virtual display |
| 126 | // consumer that isn't processing buffers fast enough. We have to do this |
| 127 | // in two places: |
| 128 | // * Here, in case the display is composed entirely by HWC. |
| 129 | // * In makeCurrent(), using eglSwapInterval. Some EGL drivers set the |
| 130 | // window's swap interval in eglMakeCurrent, so they'll override the |
| 131 | // interval we set here. |
| 132 | if (mType >= DisplayDevice::DISPLAY_VIRTUAL) |
| 133 | window->setSwapInterval(window, 0); |
| 134 | |
Michael Lentine | 47e4540 | 2014-07-18 15:34:25 -0700 | [diff] [blame] | 135 | mConfig = config; |
Jesse Hall | ffe1f19 | 2013-03-22 15:13:48 -0700 | [diff] [blame] | 136 | mDisplay = display; |
james.zhang | 5e8eb5e | 2015-12-01 17:55:11 +0800 | [diff] [blame] | 137 | mSurface = eglSurface; |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 138 | #ifndef USE_HWC2 |
| 139 | mFormat = format; |
| 140 | #endif |
Jesse Hall | ffe1f19 | 2013-03-22 15:13:48 -0700 | [diff] [blame] | 141 | mPageFlipCount = 0; |
| 142 | mViewport.makeInvalid(); |
| 143 | mFrame.makeInvalid(); |
| 144 | |
| 145 | // virtual displays are always considered enabled |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 146 | mPowerMode = (mType >= DisplayDevice::DISPLAY_VIRTUAL) ? |
| 147 | HWC_POWER_MODE_NORMAL : HWC_POWER_MODE_OFF; |
Jesse Hall | ffe1f19 | 2013-03-22 15:13:48 -0700 | [diff] [blame] | 148 | |
| 149 | // Name the display. The name will be replaced shortly if the display |
| 150 | // was created with createDisplay(). |
| 151 | switch (mType) { |
| 152 | case DISPLAY_PRIMARY: |
| 153 | mDisplayName = "Built-in Screen"; |
| 154 | break; |
| 155 | case DISPLAY_EXTERNAL: |
| 156 | mDisplayName = "HDMI Screen"; |
| 157 | break; |
| 158 | default: |
| 159 | mDisplayName = "Virtual Screen"; // e.g. Overlay #n |
| 160 | break; |
| 161 | } |
| 162 | |
| 163 | // initialize the display orientation transform. |
| 164 | setProjection(DisplayState::eOrientationDefault, mViewport, mFrame); |
james.zhang | 5e8eb5e | 2015-12-01 17:55:11 +0800 | [diff] [blame] | 165 | |
| 166 | #ifdef NUM_FRAMEBUFFER_SURFACE_BUFFERS |
| 167 | surface->allocateBuffers(); |
| 168 | #endif |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 169 | } |
| 170 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 171 | DisplayDevice::~DisplayDevice() { |
Mathias Agopian | 92a979a | 2012-08-02 18:32:23 -0700 | [diff] [blame] | 172 | if (mSurface != EGL_NO_SURFACE) { |
| 173 | eglDestroySurface(mDisplay, mSurface); |
| 174 | mSurface = EGL_NO_SURFACE; |
| 175 | } |
| 176 | } |
| 177 | |
Jesse Hall | 02d8656 | 2013-03-25 14:43:23 -0700 | [diff] [blame] | 178 | void DisplayDevice::disconnect(HWComposer& hwc) { |
| 179 | if (mHwcDisplayId >= 0) { |
| 180 | hwc.disconnectDisplay(mHwcDisplayId); |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 181 | #ifndef USE_HWC2 |
Jesse Hall | 02d8656 | 2013-03-25 14:43:23 -0700 | [diff] [blame] | 182 | if (mHwcDisplayId >= DISPLAY_VIRTUAL) |
| 183 | hwc.freeDisplayId(mHwcDisplayId); |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 184 | #endif |
Jesse Hall | 02d8656 | 2013-03-25 14:43:23 -0700 | [diff] [blame] | 185 | mHwcDisplayId = -1; |
| 186 | } |
| 187 | } |
| 188 | |
Mathias Agopian | 92a979a | 2012-08-02 18:32:23 -0700 | [diff] [blame] | 189 | bool DisplayDevice::isValid() const { |
| 190 | return mFlinger != NULL; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 191 | } |
| 192 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 193 | int DisplayDevice::getWidth() const { |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 194 | return mDisplayWidth; |
| 195 | } |
| 196 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 197 | int DisplayDevice::getHeight() const { |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 198 | return mDisplayHeight; |
| 199 | } |
| 200 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 201 | #ifndef USE_HWC2 |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 202 | PixelFormat DisplayDevice::getFormat() const { |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 203 | return mFormat; |
| 204 | } |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 205 | #endif |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 206 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 207 | EGLSurface DisplayDevice::getEGLSurface() const { |
Mathias Agopian | a491260 | 2012-07-12 14:25:33 -0700 | [diff] [blame] | 208 | return mSurface; |
| 209 | } |
| 210 | |
Mathias Agopian | 9e2463e | 2012-09-21 18:26:16 -0700 | [diff] [blame] | 211 | void DisplayDevice::setDisplayName(const String8& displayName) { |
| 212 | if (!displayName.isEmpty()) { |
| 213 | // never override the name with an empty name |
| 214 | mDisplayName = displayName; |
| 215 | } |
| 216 | } |
| 217 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 218 | uint32_t DisplayDevice::getPageFlipCount() const { |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 219 | return mPageFlipCount; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 220 | } |
| 221 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 222 | #ifndef USE_HWC2 |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 223 | status_t DisplayDevice::compositionComplete() const { |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 224 | return mDisplaySurface->compositionComplete(); |
Mathias Agopian | 74faca2 | 2009-09-17 16:18:16 -0700 | [diff] [blame] | 225 | } |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 226 | #endif |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 227 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 228 | void DisplayDevice::flip(const Region& dirty) const |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 229 | { |
Mathias Agopian | 875d8e1 | 2013-06-07 15:35:48 -0700 | [diff] [blame] | 230 | mFlinger->getRenderEngine().checkErrors(); |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 231 | |
Andreas Gampe | 89fd4f7 | 2014-11-13 14:18:56 -0800 | [diff] [blame] | 232 | if (kEGLAndroidSwapRectangle) { |
| 233 | if (mFlags & SWAP_RECTANGLE) { |
| 234 | const Region newDirty(dirty.intersect(bounds())); |
| 235 | const Rect b(newDirty.getBounds()); |
| 236 | eglSetSwapRectangleANDROID(mDisplay, mSurface, |
| 237 | b.left, b.top, b.width(), b.height()); |
| 238 | } |
Jesse Hall | 01e2905 | 2013-02-19 16:13:35 -0800 | [diff] [blame] | 239 | } |
Mathias Agopian | d870703 | 2012-09-18 01:21:55 -0700 | [diff] [blame] | 240 | |
Mathias Agopian | 076b1cc | 2009-04-10 14:24:30 -0700 | [diff] [blame] | 241 | mPageFlipCount++; |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 242 | } |
| 243 | |
Dan Stoza | 7143316 | 2014-02-04 16:22:36 -0800 | [diff] [blame] | 244 | status_t DisplayDevice::beginFrame(bool mustRecompose) const { |
| 245 | return mDisplaySurface->beginFrame(mustRecompose); |
Jesse Hall | 028dc8f | 2013-08-20 16:35:32 -0700 | [diff] [blame] | 246 | } |
| 247 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 248 | #ifdef USE_HWC2 |
| 249 | status_t DisplayDevice::prepareFrame(HWComposer& hwc) { |
| 250 | status_t error = hwc.prepare(*this); |
| 251 | if (error != NO_ERROR) { |
| 252 | return error; |
| 253 | } |
| 254 | |
| 255 | DisplaySurface::CompositionType compositionType; |
| 256 | bool hasClient = hwc.hasClientComposition(mHwcDisplayId); |
| 257 | bool hasDevice = hwc.hasDeviceComposition(mHwcDisplayId); |
| 258 | if (hasClient && hasDevice) { |
| 259 | compositionType = DisplaySurface::COMPOSITION_MIXED; |
| 260 | } else if (hasClient) { |
| 261 | compositionType = DisplaySurface::COMPOSITION_GLES; |
| 262 | } else if (hasDevice) { |
| 263 | compositionType = DisplaySurface::COMPOSITION_HWC; |
| 264 | } else { |
| 265 | // Nothing to do -- when turning the screen off we get a frame like |
| 266 | // this. Call it a HWC frame since we won't be doing any GLES work but |
| 267 | // will do a prepare/set cycle. |
| 268 | compositionType = DisplaySurface::COMPOSITION_HWC; |
| 269 | } |
| 270 | return mDisplaySurface->prepareFrame(compositionType); |
| 271 | } |
| 272 | #else |
Jesse Hall | 38efe86 | 2013-04-06 23:12:29 -0700 | [diff] [blame] | 273 | status_t DisplayDevice::prepareFrame(const HWComposer& hwc) const { |
| 274 | DisplaySurface::CompositionType compositionType; |
| 275 | bool haveGles = hwc.hasGlesComposition(mHwcDisplayId); |
| 276 | bool haveHwc = hwc.hasHwcComposition(mHwcDisplayId); |
| 277 | if (haveGles && haveHwc) { |
| 278 | compositionType = DisplaySurface::COMPOSITION_MIXED; |
| 279 | } else if (haveGles) { |
| 280 | compositionType = DisplaySurface::COMPOSITION_GLES; |
| 281 | } else if (haveHwc) { |
| 282 | compositionType = DisplaySurface::COMPOSITION_HWC; |
| 283 | } else { |
| 284 | // Nothing to do -- when turning the screen off we get a frame like |
| 285 | // this. Call it a HWC frame since we won't be doing any GLES work but |
| 286 | // will do a prepare/set cycle. |
| 287 | compositionType = DisplaySurface::COMPOSITION_HWC; |
| 288 | } |
| 289 | return mDisplaySurface->prepareFrame(compositionType); |
| 290 | } |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 291 | #endif |
Jesse Hall | 38efe86 | 2013-04-06 23:12:29 -0700 | [diff] [blame] | 292 | |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 293 | void DisplayDevice::swapBuffers(HWComposer& hwc) const { |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 294 | #ifdef USE_HWC2 |
| 295 | if (hwc.hasClientComposition(mHwcDisplayId)) { |
| 296 | #else |
Andy McFadden | 22a99f0 | 2013-08-20 16:04:47 -0700 | [diff] [blame] | 297 | // We need to call eglSwapBuffers() if: |
| 298 | // (1) we don't have a hardware composer, or |
| 299 | // (2) we did GLES composition this frame, and either |
| 300 | // (a) we have framebuffer target support (not present on legacy |
| 301 | // devices, where HWComposer::commit() handles things); or |
| 302 | // (b) this is a virtual display |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 303 | if (hwc.initCheck() != NO_ERROR || |
| 304 | (hwc.hasGlesComposition(mHwcDisplayId) && |
Andy McFadden | 22a99f0 | 2013-08-20 16:04:47 -0700 | [diff] [blame] | 305 | (hwc.supportsFramebufferTarget() || mType >= DISPLAY_VIRTUAL))) { |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 306 | #endif |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 307 | EGLBoolean success = eglSwapBuffers(mDisplay, mSurface); |
| 308 | if (!success) { |
| 309 | EGLint error = eglGetError(); |
| 310 | if (error == EGL_CONTEXT_LOST || |
| 311 | mType == DisplayDevice::DISPLAY_PRIMARY) { |
| 312 | LOG_ALWAYS_FATAL("eglSwapBuffers(%p, %p) failed with 0x%08x", |
| 313 | mDisplay, mSurface, error); |
| 314 | } else { |
| 315 | ALOGE("eglSwapBuffers(%p, %p) failed with 0x%08x", |
| 316 | mDisplay, mSurface, error); |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 317 | } |
| 318 | } |
| 319 | } |
Mathias Agopian | 52e2148 | 2012-09-24 18:07:21 -0700 | [diff] [blame] | 320 | |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 321 | status_t result = mDisplaySurface->advanceFrame(); |
| 322 | if (result != NO_ERROR) { |
| 323 | ALOGE("[%s] failed pushing new frame to HWC: %d", |
| 324 | mDisplayName.string(), result); |
Mathias Agopian | 3234138 | 2012-09-25 19:16:28 -0700 | [diff] [blame] | 325 | } |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 326 | } |
| 327 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 328 | #ifdef USE_HWC2 |
| 329 | void DisplayDevice::onSwapBuffersCompleted() const { |
| 330 | mDisplaySurface->onFrameCommitted(); |
| 331 | } |
| 332 | #else |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 333 | void DisplayDevice::onSwapBuffersCompleted(HWComposer& hwc) const { |
| 334 | if (hwc.initCheck() == NO_ERROR) { |
Jesse Hall | 851cfe8 | 2013-03-20 13:44:00 -0700 | [diff] [blame] | 335 | mDisplaySurface->onFrameCommitted(); |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 336 | } |
| 337 | } |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 338 | #endif |
Mathias Agopian | da27af9 | 2012-09-13 18:17:13 -0700 | [diff] [blame] | 339 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 340 | uint32_t DisplayDevice::getFlags() const |
The Android Open Source Project | edbf3b6 | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 341 | { |
| 342 | return mFlags; |
| 343 | } |
| 344 | |
Mathias Agopian | 875d8e1 | 2013-06-07 15:35:48 -0700 | [diff] [blame] | 345 | EGLBoolean DisplayDevice::makeCurrent(EGLDisplay dpy, EGLContext ctx) const { |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 346 | EGLBoolean result = EGL_TRUE; |
Mathias Agopian | 52bbb1a | 2012-07-31 19:01:53 -0700 | [diff] [blame] | 347 | EGLSurface sur = eglGetCurrentSurface(EGL_DRAW); |
Mathias Agopian | 875d8e1 | 2013-06-07 15:35:48 -0700 | [diff] [blame] | 348 | if (sur != mSurface) { |
| 349 | result = eglMakeCurrent(dpy, mSurface, mSurface, ctx); |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 350 | if (result == EGL_TRUE) { |
Jesse Hall | f460f55 | 2013-08-06 17:08:53 -0700 | [diff] [blame] | 351 | if (mType >= DisplayDevice::DISPLAY_VIRTUAL) |
| 352 | eglSwapInterval(dpy, 0); |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 353 | } |
Mathias Agopian | 52bbb1a | 2012-07-31 19:01:53 -0700 | [diff] [blame] | 354 | } |
Mathias Agopian | 931bda1 | 2013-08-28 18:11:46 -0700 | [diff] [blame] | 355 | setViewportAndProjection(); |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 356 | return result; |
Mathias Agopian | 52bbb1a | 2012-07-31 19:01:53 -0700 | [diff] [blame] | 357 | } |
| 358 | |
Mathias Agopian | 875d8e1 | 2013-06-07 15:35:48 -0700 | [diff] [blame] | 359 | void DisplayDevice::setViewportAndProjection() const { |
| 360 | size_t w = mDisplayWidth; |
| 361 | size_t h = mDisplayHeight; |
Dan Stoza | c187900 | 2014-05-22 15:59:05 -0700 | [diff] [blame] | 362 | Rect sourceCrop(0, 0, w, h); |
Riley Andrews | c3ebe66 | 2014-09-04 16:20:31 -0700 | [diff] [blame] | 363 | mFlinger->getRenderEngine().setViewportAndProjection(w, h, sourceCrop, h, |
| 364 | false, Transform::ROT_0); |
Mathias Agopian | bae92d0 | 2012-09-28 01:00:47 -0700 | [diff] [blame] | 365 | } |
| 366 | |
Dan Stoza | 9e56aa0 | 2015-11-02 13:00:03 -0800 | [diff] [blame^] | 367 | #ifdef USE_HWC2 |
| 368 | const sp<Fence>& DisplayDevice::getClientTargetAcquireFence() const { |
| 369 | return mDisplaySurface->getClientTargetAcquireFence(); |
| 370 | } |
| 371 | #endif |
| 372 | |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 373 | // ---------------------------------------------------------------------------- |
| 374 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 375 | void DisplayDevice::setVisibleLayersSortedByZ(const Vector< sp<Layer> >& layers) { |
Mathias Agopian | 3b1d2b6 | 2012-07-11 13:48:17 -0700 | [diff] [blame] | 376 | mVisibleLayersSortedByZ = layers; |
Mathias Agopian | 3b1d2b6 | 2012-07-11 13:48:17 -0700 | [diff] [blame] | 377 | } |
| 378 | |
Mathias Agopian | 13127d8 | 2013-03-05 17:47:11 -0800 | [diff] [blame] | 379 | const Vector< sp<Layer> >& DisplayDevice::getVisibleLayersSortedByZ() const { |
Mathias Agopian | 3b1d2b6 | 2012-07-11 13:48:17 -0700 | [diff] [blame] | 380 | return mVisibleLayersSortedByZ; |
| 381 | } |
| 382 | |
Mathias Agopian | cd60f99 | 2012-08-16 16:28:27 -0700 | [diff] [blame] | 383 | Region DisplayDevice::getDirtyRegion(bool repaintEverything) const { |
| 384 | Region dirty; |
Mathias Agopian | cd60f99 | 2012-08-16 16:28:27 -0700 | [diff] [blame] | 385 | if (repaintEverything) { |
| 386 | dirty.set(getBounds()); |
| 387 | } else { |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 388 | const Transform& planeTransform(mGlobalTransform); |
Mathias Agopian | cd60f99 | 2012-08-16 16:28:27 -0700 | [diff] [blame] | 389 | dirty = planeTransform.transform(this->dirtyRegion); |
| 390 | dirty.andSelf(getBounds()); |
| 391 | } |
| 392 | return dirty; |
| 393 | } |
| 394 | |
Mathias Agopian | 3b1d2b6 | 2012-07-11 13:48:17 -0700 | [diff] [blame] | 395 | // ---------------------------------------------------------------------------- |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 396 | void DisplayDevice::setPowerMode(int mode) { |
| 397 | mPowerMode = mode; |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 398 | } |
| 399 | |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 400 | int DisplayDevice::getPowerMode() const { |
| 401 | return mPowerMode; |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 402 | } |
| 403 | |
Prashant Malani | 2c9b11f | 2014-05-25 01:36:31 -0700 | [diff] [blame] | 404 | bool DisplayDevice::isDisplayOn() const { |
| 405 | return (mPowerMode != HWC_POWER_MODE_OFF); |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | // ---------------------------------------------------------------------------- |
Michael Lentine | 6c9e34a | 2014-07-14 13:48:55 -0700 | [diff] [blame] | 409 | void DisplayDevice::setActiveConfig(int mode) { |
| 410 | mActiveConfig = mode; |
| 411 | } |
| 412 | |
| 413 | int DisplayDevice::getActiveConfig() const { |
| 414 | return mActiveConfig; |
| 415 | } |
| 416 | |
| 417 | // ---------------------------------------------------------------------------- |
Mathias Agopian | d3ee231 | 2012-08-02 14:01:42 -0700 | [diff] [blame] | 418 | |
Mathias Agopian | 28947d7 | 2012-08-08 18:51:15 -0700 | [diff] [blame] | 419 | void DisplayDevice::setLayerStack(uint32_t stack) { |
| 420 | mLayerStack = stack; |
| 421 | dirtyRegion.set(bounds()); |
| 422 | } |
| 423 | |
| 424 | // ---------------------------------------------------------------------------- |
| 425 | |
Mathias Agopian | c1c05de | 2013-09-17 23:45:22 -0700 | [diff] [blame] | 426 | uint32_t DisplayDevice::getOrientationTransform() const { |
| 427 | uint32_t transform = 0; |
| 428 | switch (mOrientation) { |
| 429 | case DisplayState::eOrientationDefault: |
| 430 | transform = Transform::ROT_0; |
| 431 | break; |
| 432 | case DisplayState::eOrientation90: |
| 433 | transform = Transform::ROT_90; |
| 434 | break; |
| 435 | case DisplayState::eOrientation180: |
| 436 | transform = Transform::ROT_180; |
| 437 | break; |
| 438 | case DisplayState::eOrientation270: |
| 439 | transform = Transform::ROT_270; |
| 440 | break; |
| 441 | } |
| 442 | return transform; |
| 443 | } |
| 444 | |
Mathias Agopian | 0f2f5ff | 2012-07-31 23:09:07 -0700 | [diff] [blame] | 445 | status_t DisplayDevice::orientationToTransfrom( |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 446 | int orientation, int w, int h, Transform* tr) |
| 447 | { |
| 448 | uint32_t flags = 0; |
| 449 | switch (orientation) { |
Mathias Agopian | 3165cc2 | 2012-08-08 19:42:09 -0700 | [diff] [blame] | 450 | case DisplayState::eOrientationDefault: |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 451 | flags = Transform::ROT_0; |
| 452 | break; |
Mathias Agopian | 3165cc2 | 2012-08-08 19:42:09 -0700 | [diff] [blame] | 453 | case DisplayState::eOrientation90: |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 454 | flags = Transform::ROT_90; |
| 455 | break; |
Mathias Agopian | 3165cc2 | 2012-08-08 19:42:09 -0700 | [diff] [blame] | 456 | case DisplayState::eOrientation180: |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 457 | flags = Transform::ROT_180; |
| 458 | break; |
Mathias Agopian | 3165cc2 | 2012-08-08 19:42:09 -0700 | [diff] [blame] | 459 | case DisplayState::eOrientation270: |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 460 | flags = Transform::ROT_270; |
| 461 | break; |
| 462 | default: |
| 463 | return BAD_VALUE; |
| 464 | } |
| 465 | tr->set(flags, w, h); |
| 466 | return NO_ERROR; |
| 467 | } |
| 468 | |
Michael Lentine | 47e4540 | 2014-07-18 15:34:25 -0700 | [diff] [blame] | 469 | void DisplayDevice::setDisplaySize(const int newWidth, const int newHeight) { |
| 470 | dirtyRegion.set(getBounds()); |
| 471 | |
Michael Lentine | f2568de | 2014-08-20 10:51:23 -0700 | [diff] [blame] | 472 | if (mSurface != EGL_NO_SURFACE) { |
| 473 | eglDestroySurface(mDisplay, mSurface); |
| 474 | mSurface = EGL_NO_SURFACE; |
| 475 | } |
| 476 | |
Michael Lentine | 47e4540 | 2014-07-18 15:34:25 -0700 | [diff] [blame] | 477 | mDisplaySurface->resizeBuffers(newWidth, newHeight); |
| 478 | |
| 479 | ANativeWindow* const window = mNativeWindow.get(); |
| 480 | mSurface = eglCreateWindowSurface(mDisplay, mConfig, window, NULL); |
| 481 | eglQuerySurface(mDisplay, mSurface, EGL_WIDTH, &mDisplayWidth); |
| 482 | eglQuerySurface(mDisplay, mSurface, EGL_HEIGHT, &mDisplayHeight); |
| 483 | |
| 484 | LOG_FATAL_IF(mDisplayWidth != newWidth, |
| 485 | "Unable to set new width to %d", newWidth); |
| 486 | LOG_FATAL_IF(mDisplayHeight != newHeight, |
| 487 | "Unable to set new height to %d", newHeight); |
| 488 | } |
| 489 | |
Mathias Agopian | 00e8c7a | 2012-09-04 19:30:46 -0700 | [diff] [blame] | 490 | void DisplayDevice::setProjection(int orientation, |
Mathias Agopian | f5f714a | 2013-02-26 16:54:05 -0800 | [diff] [blame] | 491 | const Rect& newViewport, const Rect& newFrame) { |
| 492 | Rect viewport(newViewport); |
| 493 | Rect frame(newFrame); |
| 494 | |
| 495 | const int w = mDisplayWidth; |
| 496 | const int h = mDisplayHeight; |
| 497 | |
| 498 | Transform R; |
| 499 | DisplayDevice::orientationToTransfrom(orientation, w, h, &R); |
| 500 | |
| 501 | if (!frame.isValid()) { |
| 502 | // the destination frame can be invalid if it has never been set, |
| 503 | // in that case we assume the whole display frame. |
| 504 | frame = Rect(w, h); |
| 505 | } |
| 506 | |
| 507 | if (viewport.isEmpty()) { |
| 508 | // viewport can be invalid if it has never been set, in that case |
| 509 | // we assume the whole display size. |
| 510 | // it's also invalid to have an empty viewport, so we handle that |
| 511 | // case in the same way. |
| 512 | viewport = Rect(w, h); |
| 513 | if (R.getOrientation() & Transform::ROT_90) { |
| 514 | // viewport is always specified in the logical orientation |
| 515 | // of the display (ie: post-rotation). |
| 516 | swap(viewport.right, viewport.bottom); |
| 517 | } |
| 518 | } |
| 519 | |
| 520 | dirtyRegion.set(getBounds()); |
| 521 | |
| 522 | Transform TL, TP, S; |
| 523 | float src_width = viewport.width(); |
| 524 | float src_height = viewport.height(); |
| 525 | float dst_width = frame.width(); |
| 526 | float dst_height = frame.height(); |
| 527 | if (src_width != dst_width || src_height != dst_height) { |
| 528 | float sx = dst_width / src_width; |
| 529 | float sy = dst_height / src_height; |
| 530 | S.set(sx, 0, 0, sy); |
| 531 | } |
| 532 | |
| 533 | float src_x = viewport.left; |
| 534 | float src_y = viewport.top; |
| 535 | float dst_x = frame.left; |
| 536 | float dst_y = frame.top; |
| 537 | TL.set(-src_x, -src_y); |
| 538 | TP.set(dst_x, dst_y); |
| 539 | |
| 540 | // The viewport and frame are both in the logical orientation. |
| 541 | // Apply the logical translation, scale to physical size, apply the |
| 542 | // physical translation and finally rotate to the physical orientation. |
| 543 | mGlobalTransform = R * TP * S * TL; |
| 544 | |
| 545 | const uint8_t type = mGlobalTransform.getType(); |
| 546 | mNeedsFiltering = (!mGlobalTransform.preserveRects() || |
| 547 | (type >= Transform::SCALE)); |
| 548 | |
| 549 | mScissor = mGlobalTransform.transform(viewport); |
| 550 | if (mScissor.isEmpty()) { |
Mathias Agopian | 6c7f25a | 2013-05-09 20:37:10 -0700 | [diff] [blame] | 551 | mScissor = getBounds(); |
Mathias Agopian | f5f714a | 2013-02-26 16:54:05 -0800 | [diff] [blame] | 552 | } |
| 553 | |
Mathias Agopian | da8d0a5 | 2012-09-04 15:05:38 -0700 | [diff] [blame] | 554 | mOrientation = orientation; |
Mathias Agopian | 00e8c7a | 2012-09-04 19:30:46 -0700 | [diff] [blame] | 555 | mViewport = viewport; |
| 556 | mFrame = frame; |
Mathias Agopian | 1b03149 | 2012-06-20 17:51:20 -0700 | [diff] [blame] | 557 | } |
Mathias Agopian | 1d12d8a | 2012-09-18 01:38:00 -0700 | [diff] [blame] | 558 | |
Mathias Agopian | 74d211a | 2013-04-22 16:55:35 +0200 | [diff] [blame] | 559 | void DisplayDevice::dump(String8& result) const { |
Mathias Agopian | 1d12d8a | 2012-09-18 01:38:00 -0700 | [diff] [blame] | 560 | const Transform& tr(mGlobalTransform); |
Mathias Agopian | 74d211a | 2013-04-22 16:55:35 +0200 | [diff] [blame] | 561 | result.appendFormat( |
Mathias Agopian | 1d12d8a | 2012-09-18 01:38:00 -0700 | [diff] [blame] | 562 | "+ DisplayDevice: %s\n" |
Jesse Hall | 02d8656 | 2013-03-25 14:43:23 -0700 | [diff] [blame] | 563 | " type=%x, hwcId=%d, layerStack=%u, (%4dx%4d), ANativeWindow=%p, orient=%2d (type=%08x), " |
Pablo Ceballos | b5b3563 | 2016-02-23 11:18:51 -0800 | [diff] [blame] | 564 | "flips=%u, isSecure=%d, powerMode=%d, activeConfig=%d, numLayers=%zu\n" |
Mathias Agopian | 766dc49 | 2012-10-30 18:08:06 -0700 | [diff] [blame] | 565 | " v:[%d,%d,%d,%d], f:[%d,%d,%d,%d], s:[%d,%d,%d,%d]," |
Mathias Agopian | 1d12d8a | 2012-09-18 01:38:00 -0700 | [diff] [blame] | 566 | "transform:[[%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f]]\n", |
Jesse Hall | 02d8656 | 2013-03-25 14:43:23 -0700 | [diff] [blame] | 567 | mDisplayName.string(), mType, mHwcDisplayId, |
Mathias Agopian | 1d12d8a | 2012-09-18 01:38:00 -0700 | [diff] [blame] | 568 | mLayerStack, mDisplayWidth, mDisplayHeight, mNativeWindow.get(), |
| 569 | mOrientation, tr.getType(), getPageFlipCount(), |
Pablo Ceballos | b5b3563 | 2016-02-23 11:18:51 -0800 | [diff] [blame] | 570 | mIsSecure, mPowerMode, mActiveConfig, |
Michael Lentine | 6c9e34a | 2014-07-14 13:48:55 -0700 | [diff] [blame] | 571 | mVisibleLayersSortedByZ.size(), |
Mathias Agopian | 1d12d8a | 2012-09-18 01:38:00 -0700 | [diff] [blame] | 572 | mViewport.left, mViewport.top, mViewport.right, mViewport.bottom, |
| 573 | mFrame.left, mFrame.top, mFrame.right, mFrame.bottom, |
Mathias Agopian | 766dc49 | 2012-10-30 18:08:06 -0700 | [diff] [blame] | 574 | mScissor.left, mScissor.top, mScissor.right, mScissor.bottom, |
Mathias Agopian | 1d12d8a | 2012-09-18 01:38:00 -0700 | [diff] [blame] | 575 | tr[0][0], tr[1][0], tr[2][0], |
| 576 | tr[0][1], tr[1][1], tr[2][1], |
| 577 | tr[0][2], tr[1][2], tr[2][2]); |
| 578 | |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 579 | String8 surfaceDump; |
Dan Stoza | f10c46e | 2014-11-11 10:32:31 -0800 | [diff] [blame] | 580 | mDisplaySurface->dumpAsString(surfaceDump); |
Jesse Hall | 99c7dbb | 2013-03-14 14:29:29 -0700 | [diff] [blame] | 581 | result.append(surfaceDump); |
Mathias Agopian | 1d12d8a | 2012-09-18 01:38:00 -0700 | [diff] [blame] | 582 | } |