Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 1 | /* |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 2 | * Copyright (C) 2013 The Android Open Source Project |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 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 | |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 17 | #include <malloc.h> |
| 18 | #include <string.h> |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 19 | #include <pthread.h> |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 20 | |
| 21 | #include "RenderScript.h" |
Tim Murray | 89daad6 | 2013-07-29 14:30:02 -0700 | [diff] [blame] | 22 | #include "rsCppStructs.h" |
Tim Murray | eeaf714 | 2013-09-09 15:03:50 -0700 | [diff] [blame] | 23 | #include "rsCppInternal.h" |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 24 | |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 25 | #include <dlfcn.h> |
Tim Murray | 0f98d50 | 2014-01-15 14:35:31 -0800 | [diff] [blame] | 26 | #include <unistd.h> |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 27 | |
Tim Murray | 0f98d50 | 2014-01-15 14:35:31 -0800 | [diff] [blame] | 28 | #if !defined(RS_SERVER) && !defined(RS_COMPATIBILITY_LIB) && defined(HAVE_ANDROID_OS) |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 29 | #include <cutils/properties.h> |
Tim Murray | 0f98d50 | 2014-01-15 14:35:31 -0800 | [diff] [blame] | 30 | #else |
| 31 | #include "rsCompatibilityLib.h" |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 32 | #endif |
| 33 | |
Tim Murray | 0f98d50 | 2014-01-15 14:35:31 -0800 | [diff] [blame] | 34 | |
Jason Sams | 69cccdf | 2012-04-02 19:11:49 -0700 | [diff] [blame] | 35 | using namespace android; |
Tim Murray | 9eb7f4b | 2012-11-16 14:02:18 -0800 | [diff] [blame] | 36 | using namespace RSC; |
Jason Sams | 69cccdf | 2012-04-02 19:11:49 -0700 | [diff] [blame] | 37 | |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 38 | bool RS::gInitialized = false; |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 39 | bool RS::usingNative = false; |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 40 | pthread_mutex_t RS::gInitMutex = PTHREAD_MUTEX_INITIALIZER; |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 41 | dispatchTable* RS::dispatch = nullptr; |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 42 | static int gInitError = 0; |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 43 | |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 44 | RS::RS() { |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 45 | mDev = nullptr; |
| 46 | mContext = nullptr; |
| 47 | mErrorFunc = nullptr; |
| 48 | mMessageFunc = nullptr; |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 49 | mMessageRun = false; |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 50 | mInit = false; |
Tim Murray | 21fa7a0 | 2013-08-15 16:25:03 -0700 | [diff] [blame] | 51 | mCurrentError = RS_SUCCESS; |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 52 | |
| 53 | memset(&mElements, 0, sizeof(mElements)); |
Tim Murray | 729b6fe | 2013-07-23 16:20:42 -0700 | [diff] [blame] | 54 | memset(&mSamplers, 0, sizeof(mSamplers)); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 55 | } |
| 56 | |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 57 | RS::~RS() { |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 58 | if (mInit == true) { |
| 59 | mMessageRun = false; |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 60 | |
Xiaofei Wan | fea96e8 | 2014-03-31 16:43:15 +0800 | [diff] [blame] | 61 | if (mContext) { |
| 62 | RS::dispatch->ContextDeinitToClient(mContext); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 63 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 64 | void *res = nullptr; |
Xiaofei Wan | fea96e8 | 2014-03-31 16:43:15 +0800 | [diff] [blame] | 65 | int status = pthread_join(mMessageThreadId, &res); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 66 | |
Xiaofei Wan | fea96e8 | 2014-03-31 16:43:15 +0800 | [diff] [blame] | 67 | RS::dispatch->ContextDestroy(mContext); |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 68 | mContext = nullptr; |
Xiaofei Wan | fea96e8 | 2014-03-31 16:43:15 +0800 | [diff] [blame] | 69 | } |
| 70 | if (mDev) { |
| 71 | RS::dispatch->DeviceDestroy(mDev); |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 72 | mDev = nullptr; |
Xiaofei Wan | fea96e8 | 2014-03-31 16:43:15 +0800 | [diff] [blame] | 73 | } |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 74 | } |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 75 | } |
| 76 | |
Miao Wang | bc10dff | 2015-04-03 17:44:55 -0700 | [diff] [blame] | 77 | bool RS::init(const char * name, uint32_t flags) { |
Tim Murray | caf4126 | 2013-12-13 12:54:37 -0800 | [diff] [blame] | 78 | return RS::init(name, RS_VERSION, flags); |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 79 | } |
| 80 | |
Tim Murray | 75e877d | 2013-09-11 14:45:20 -0700 | [diff] [blame] | 81 | // this will only open API 19+ libRS |
| 82 | // because that's when we changed libRS to extern "C" entry points |
Miao Wang | e5428e6 | 2015-03-10 15:29:40 -0700 | [diff] [blame] | 83 | static bool loadSO(const char* filename, int targetApi) { |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 84 | void* handle = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 85 | if (handle == nullptr) { |
Tim Murray | 87c9d77 | 2013-12-03 12:42:00 -0800 | [diff] [blame] | 86 | ALOGV("couldn't dlopen %s, %s", filename, dlerror()); |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 87 | return false; |
| 88 | } |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 89 | |
Miao Wang | e5428e6 | 2015-03-10 15:29:40 -0700 | [diff] [blame] | 90 | if (loadSymbols(handle, *RS::dispatch, targetApi) == false) { |
Tim Murray | 87c9d77 | 2013-12-03 12:42:00 -0800 | [diff] [blame] | 91 | ALOGV("%s init failed!", filename); |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 92 | return false; |
| 93 | } |
Tim Murray | 84e3dea | 2013-09-09 16:12:51 -0700 | [diff] [blame] | 94 | //ALOGE("Successfully loaded %s", filename); |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 95 | return true; |
| 96 | } |
| 97 | |
| 98 | static uint32_t getProp(const char *str) { |
Tim Murray | cbbac9f | 2014-09-10 15:42:29 -0700 | [diff] [blame] | 99 | #if !defined(__LP64__) && !defined(RS_SERVER) && defined(HAVE_ANDROID_OS) |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 100 | char buf[256]; |
| 101 | property_get(str, buf, "0"); |
| 102 | return atoi(buf); |
| 103 | #else |
| 104 | return 0; |
| 105 | #endif |
| 106 | } |
| 107 | |
| 108 | bool RS::initDispatch(int targetApi) { |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 109 | pthread_mutex_lock(&gInitMutex); |
| 110 | if (gInitError) { |
| 111 | goto error; |
| 112 | } else if (gInitialized) { |
Tim Murray | 47666f5 | 2013-07-29 14:32:34 -0700 | [diff] [blame] | 113 | pthread_mutex_unlock(&gInitMutex); |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 114 | return true; |
| 115 | } |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 116 | |
| 117 | RS::dispatch = new dispatchTable; |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 118 | |
| 119 | // attempt to load libRS, load libRSSupport on failure |
| 120 | // if property is set, proceed directly to libRSSupport |
| 121 | if (getProp("debug.rs.forcecompat") == 0) { |
Miao Wang | e5428e6 | 2015-03-10 15:29:40 -0700 | [diff] [blame] | 122 | usingNative = loadSO("libRS.so", targetApi); |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 123 | } |
| 124 | if (usingNative == false) { |
Miao Wang | e5428e6 | 2015-03-10 15:29:40 -0700 | [diff] [blame] | 125 | if (loadSO("libRSSupport.so", targetApi) == false) { |
Tim Murray | 4a92d12 | 2013-07-22 10:56:18 -0700 | [diff] [blame] | 126 | ALOGE("Failed to load libRS.so and libRSSupport.so"); |
| 127 | goto error; |
| 128 | } |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | gInitialized = true; |
| 132 | |
| 133 | pthread_mutex_unlock(&gInitMutex); |
| 134 | return true; |
| 135 | |
| 136 | error: |
| 137 | gInitError = 1; |
| 138 | pthread_mutex_unlock(&gInitMutex); |
| 139 | return false; |
| 140 | } |
| 141 | |
Miao Wang | bc10dff | 2015-04-03 17:44:55 -0700 | [diff] [blame] | 142 | bool RS::init(const char * name, int targetApi, uint32_t flags) { |
Tim Murray | caf4126 | 2013-12-13 12:54:37 -0800 | [diff] [blame] | 143 | if (mInit) { |
| 144 | return true; |
| 145 | } |
| 146 | |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 147 | if (initDispatch(targetApi) == false) { |
| 148 | ALOGE("Couldn't initialize dispatch table"); |
| 149 | return false; |
| 150 | } |
| 151 | |
Miao Wang | bc10dff | 2015-04-03 17:44:55 -0700 | [diff] [blame] | 152 | uint32_t nameLen = strlen(name); |
| 153 | if (nameLen > PATH_MAX) { |
| 154 | ALOGE("The path to the cache directory is too long"); |
| 155 | return false; |
| 156 | } |
| 157 | memcpy(mCacheDir, name, nameLen); |
| 158 | mCacheDir[nameLen] = 0; //add the null character even if the user does not. |
| 159 | mCacheDirLen = nameLen + 1; |
Tim Murray | caf4126 | 2013-12-13 12:54:37 -0800 | [diff] [blame] | 160 | |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 161 | mDev = RS::dispatch->DeviceCreate(); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 162 | if (mDev == 0) { |
| 163 | ALOGE("Device creation failed"); |
| 164 | return false; |
| 165 | } |
| 166 | |
Jason Sams | bfa5a8e | 2014-05-20 18:16:20 -0700 | [diff] [blame] | 167 | if (flags & ~(RS_CONTEXT_SYNCHRONOUS | RS_CONTEXT_LOW_LATENCY | |
| 168 | RS_CONTEXT_LOW_POWER)) { |
Tim Murray | 84e3dea | 2013-09-09 16:12:51 -0700 | [diff] [blame] | 169 | ALOGE("Invalid flags passed"); |
| 170 | return false; |
| 171 | } |
| 172 | |
| 173 | mContext = RS::dispatch->ContextCreate(mDev, 0, targetApi, RS_CONTEXT_TYPE_NORMAL, flags); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 174 | if (mContext == 0) { |
| 175 | ALOGE("Context creation failed"); |
| 176 | return false; |
| 177 | } |
| 178 | |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 179 | pid_t mNativeMessageThreadId; |
| 180 | |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 181 | int status = pthread_create(&mMessageThreadId, nullptr, threadProc, this); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 182 | if (status) { |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 183 | ALOGE("Failed to start RS message thread."); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 184 | return false; |
| 185 | } |
| 186 | // Wait for the message thread to be active. |
| 187 | while (!mMessageRun) { |
| 188 | usleep(1000); |
| 189 | } |
| 190 | |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 191 | mInit = true; |
| 192 | |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 193 | return true; |
| 194 | } |
| 195 | |
Tim Murray | 21fa7a0 | 2013-08-15 16:25:03 -0700 | [diff] [blame] | 196 | void RS::throwError(RSError error, const char *errMsg) { |
| 197 | if (mCurrentError == RS_SUCCESS) { |
| 198 | mCurrentError = error; |
| 199 | ALOGE("RS CPP error: %s", errMsg); |
| 200 | } else { |
| 201 | ALOGE("RS CPP error (masked by previous error): %s", errMsg); |
| 202 | } |
Jason Sams | b2e3dc5 | 2012-02-23 17:14:39 -0800 | [diff] [blame] | 203 | } |
| 204 | |
Tim Murray | 10913a5 | 2013-08-20 17:19:47 -0700 | [diff] [blame] | 205 | RSError RS::getError() { |
| 206 | return mCurrentError; |
| 207 | } |
| 208 | |
Jason Sams | b2e3dc5 | 2012-02-23 17:14:39 -0800 | [diff] [blame] | 209 | |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 210 | void * RS::threadProc(void *vrsc) { |
| 211 | RS *rs = static_cast<RS *>(vrsc); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 212 | size_t rbuf_size = 256; |
| 213 | void * rbuf = malloc(rbuf_size); |
| 214 | |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 215 | RS::dispatch->ContextInitToClient(rs->mContext); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 216 | rs->mMessageRun = true; |
| 217 | |
| 218 | while (rs->mMessageRun) { |
| 219 | size_t receiveLen = 0; |
| 220 | uint32_t usrID = 0; |
| 221 | uint32_t subID = 0; |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 222 | RsMessageToClientType r = RS::dispatch->ContextPeekMessage(rs->mContext, |
| 223 | &receiveLen, sizeof(receiveLen), |
| 224 | &usrID, sizeof(usrID)); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 225 | |
| 226 | if (receiveLen >= rbuf_size) { |
| 227 | rbuf_size = receiveLen + 32; |
| 228 | rbuf = realloc(rbuf, rbuf_size); |
| 229 | } |
| 230 | if (!rbuf) { |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 231 | ALOGE("RS::message handler realloc error %zu", rbuf_size); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 232 | // No clean way to recover now? |
| 233 | } |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 234 | RS::dispatch->ContextGetMessage(rs->mContext, rbuf, rbuf_size, &receiveLen, sizeof(receiveLen), |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 235 | &subID, sizeof(subID)); |
| 236 | |
| 237 | switch(r) { |
| 238 | case RS_MESSAGE_TO_CLIENT_ERROR: |
| 239 | ALOGE("RS Error %s", (const char *)rbuf); |
Tim Murray | 21fa7a0 | 2013-08-15 16:25:03 -0700 | [diff] [blame] | 240 | rs->throwError(RS_ERROR_RUNTIME_ERROR, "Error returned from runtime"); |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 241 | if(rs->mMessageFunc != nullptr) { |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 242 | rs->mErrorFunc(usrID, (const char *)rbuf); |
| 243 | } |
| 244 | break; |
Stephen Hines | 76a1be4 | 2012-11-26 16:26:03 -0800 | [diff] [blame] | 245 | case RS_MESSAGE_TO_CLIENT_NONE: |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 246 | case RS_MESSAGE_TO_CLIENT_EXCEPTION: |
Stephen Hines | 76a1be4 | 2012-11-26 16:26:03 -0800 | [diff] [blame] | 247 | case RS_MESSAGE_TO_CLIENT_RESIZE: |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 248 | // teardown. But we want to avoid starving other threads during |
| 249 | // teardown by yielding until the next line in the destructor can |
Stephen Hines | 76a1be4 | 2012-11-26 16:26:03 -0800 | [diff] [blame] | 250 | // execute to set mRun = false. Note that the FIFO sends an |
| 251 | // empty NONE message when it reaches its destructor. |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 252 | usleep(1000); |
| 253 | break; |
| 254 | case RS_MESSAGE_TO_CLIENT_USER: |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 255 | if(rs->mMessageFunc != nullptr) { |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 256 | rs->mMessageFunc(usrID, rbuf, receiveLen); |
| 257 | } else { |
| 258 | ALOGE("Received a message from the script with no message handler installed."); |
| 259 | } |
| 260 | break; |
| 261 | |
| 262 | default: |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 263 | ALOGE("RS unknown message type %i", r); |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 264 | } |
| 265 | } |
| 266 | |
| 267 | if (rbuf) { |
| 268 | free(rbuf); |
| 269 | } |
Tim Murray | 87c9d77 | 2013-12-03 12:42:00 -0800 | [diff] [blame] | 270 | ALOGV("RS Message thread exiting."); |
Chris Wailes | 44bef6f | 2014-08-12 13:51:10 -0700 | [diff] [blame] | 271 | return nullptr; |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 272 | } |
| 273 | |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 274 | void RS::setErrorHandler(ErrorHandlerFunc_t func) { |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 275 | mErrorFunc = func; |
| 276 | } |
| 277 | |
Tim Murray | 84bf2b8 | 2012-10-31 16:03:16 -0700 | [diff] [blame] | 278 | void RS::setMessageHandler(MessageHandlerFunc_t func) { |
Jason Sams | 221a4b1 | 2012-02-22 15:22:41 -0800 | [diff] [blame] | 279 | mMessageFunc = func; |
| 280 | } |
Tim Murray | baca6c3 | 2012-11-14 16:51:46 -0800 | [diff] [blame] | 281 | |
| 282 | void RS::finish() { |
Tim Murray | a423096 | 2013-07-17 16:50:10 -0700 | [diff] [blame] | 283 | RS::dispatch->ContextFinish(mContext); |
Tim Murray | baca6c3 | 2012-11-14 16:51:46 -0800 | [diff] [blame] | 284 | } |