blob: 2beec3decb3937949555f85f61638a32a21b9a31 [file] [log] [blame]
Jason Samscf9ea9f2012-09-23 17:00:54 -07001/*
2 * Copyright (C) 2012 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
17
Jason Sams709a0972012-11-15 18:18:04 -080018#include "rsCpuIntrinsic.h"
19#include "rsCpuIntrinsicInlines.h"
Jason Samscf9ea9f2012-09-23 17:00:54 -070020
21using namespace android;
22using namespace android::renderscript;
23
Jason Sams709a0972012-11-15 18:18:04 -080024namespace android {
25namespace renderscript {
26
27
28class RsdCpuScriptIntrinsicBlend : public RsdCpuScriptIntrinsic {
29public:
30 virtual void populateScript(Script *);
31
32 virtual ~RsdCpuScriptIntrinsicBlend();
Jason Samsc905efd2012-11-26 15:20:18 -080033 RsdCpuScriptIntrinsicBlend(RsdCpuReferenceImpl *ctx, const Script *s, const Element *e);
Jason Sams709a0972012-11-15 18:18:04 -080034
35protected:
Chris Wailes9ed79102014-07-25 15:53:28 -070036 static void kernel(const RsExpandKernelParams *p, uint32_t xstart,
37 uint32_t xend, uint32_t outstep);
Jason Samscf9ea9f2012-09-23 17:00:54 -070038};
39
Jason Sams709a0972012-11-15 18:18:04 -080040}
41}
42
Jason Samscf9ea9f2012-09-23 17:00:54 -070043
Jason Samscf9ea9f2012-09-23 17:00:54 -070044enum {
45 BLEND_CLEAR = 0,
46 BLEND_SRC = 1,
47 BLEND_DST = 2,
48 BLEND_SRC_OVER = 3,
49 BLEND_DST_OVER = 4,
50 BLEND_SRC_IN = 5,
51 BLEND_DST_IN = 6,
52 BLEND_SRC_OUT = 7,
53 BLEND_DST_OUT = 8,
54 BLEND_SRC_ATOP = 9,
55 BLEND_DST_ATOP = 10,
56 BLEND_XOR = 11,
57
58 BLEND_NORMAL = 12,
59 BLEND_AVERAGE = 13,
60 BLEND_MULTIPLY = 14,
61 BLEND_SCREEN = 15,
62 BLEND_DARKEN = 16,
63 BLEND_LIGHTEN = 17,
64 BLEND_OVERLAY = 18,
65 BLEND_HARDLIGHT = 19,
66 BLEND_SOFTLIGHT = 20,
67 BLEND_DIFFERENCE = 21,
68 BLEND_NEGATION = 22,
69 BLEND_EXCLUSION = 23,
70 BLEND_COLOR_DODGE = 24,
71 BLEND_INVERSE_COLOR_DODGE = 25,
72 BLEND_SOFT_DODGE = 26,
73 BLEND_COLOR_BURN = 27,
74 BLEND_INVERSE_COLOR_BURN = 28,
75 BLEND_SOFT_BURN = 29,
76 BLEND_REFLECT = 30,
77 BLEND_GLOW = 31,
78 BLEND_FREEZE = 32,
79 BLEND_HEAT = 33,
80 BLEND_ADD = 34,
81 BLEND_SUBTRACT = 35,
82 BLEND_STAMP = 36,
83 BLEND_RED = 37,
84 BLEND_GREEN = 38,
85 BLEND_BLUE = 39,
86 BLEND_HUE = 40,
87 BLEND_SATURATION = 41,
88 BLEND_COLOR = 42,
89 BLEND_LUMINOSITY = 43
90};
91
Jason Sams074424a2014-05-22 13:30:03 -070092#if defined(ARCH_ARM_USE_INTRINSICS)
Simon Hosie5d069192014-02-19 16:33:45 -080093extern "C" int rsdIntrinsicBlend_K(uchar4 *out, uchar4 const *in, int slot,
94 uint32_t xstart, uint32_t xend);
Rose, James7b7060c2014-04-22 12:08:06 +080095#endif
96
97#if defined(ARCH_X86_HAVE_SSSE3)
98extern "C" void rsdIntrinsicBlendSrcOver_K(void *dst, const void *src, uint32_t count8);
99extern "C" void rsdIntrinsicBlendDstOver_K(void *dst, const void *src, uint32_t count8);
100extern "C" void rsdIntrinsicBlendSrcIn_K(void *dst, const void *src, uint32_t count8);
101extern "C" void rsdIntrinsicBlendDstIn_K(void *dst, const void *src, uint32_t count8);
102extern "C" void rsdIntrinsicBlendSrcOut_K(void *dst, const void *src, uint32_t count8);
103extern "C" void rsdIntrinsicBlendDstOut_K(void *dst, const void *src, uint32_t count8);
104extern "C" void rsdIntrinsicBlendSrcAtop_K(void *dst, const void *src, uint32_t count8);
105extern "C" void rsdIntrinsicBlendDstAtop_K(void *dst, const void *src, uint32_t count8);
106extern "C" void rsdIntrinsicBlendXor_K(void *dst, const void *src, uint32_t count8);
107extern "C" void rsdIntrinsicBlendMultiply_K(void *dst, const void *src, uint32_t count8);
108extern "C" void rsdIntrinsicBlendAdd_K(void *dst, const void *src, uint32_t count8);
109extern "C" void rsdIntrinsicBlendSub_K(void *dst, const void *src, uint32_t count8);
110#endif
Jason Samsfa17cda2012-09-26 18:33:58 -0700111
Chris Wailes80ef6932014-07-08 11:22:18 -0700112void RsdCpuScriptIntrinsicBlend::kernel(const RsExpandKernelParams *p,
Jason Sams709a0972012-11-15 18:18:04 -0800113 uint32_t xstart, uint32_t xend,
Chris Wailes9ed79102014-07-25 15:53:28 -0700114 uint32_t outstep) {
Jason Sams709a0972012-11-15 18:18:04 -0800115 RsdCpuScriptIntrinsicBlend *cp = (RsdCpuScriptIntrinsicBlend *)p->usr;
Tim Murray36889a02012-09-24 14:52:48 -0700116
117 // instep/outstep can be ignored--sizeof(uchar4) known at compile time
Jason Samscf9ea9f2012-09-23 17:00:54 -0700118 uchar4 *out = (uchar4 *)p->out;
Chris Wailesf3712132014-07-16 15:18:30 -0700119 uchar4 *in = (uchar4 *)p->ins[0];
Jason Samscf9ea9f2012-09-23 17:00:54 -0700120 uint32_t x1 = xstart;
121 uint32_t x2 = xend;
122
Jason Sams074424a2014-05-22 13:30:03 -0700123#if defined(ARCH_ARM_USE_INTRINSICS) && !defined(ARCH_ARM64_USE_INTRINSICS)
Simon Hosie5d069192014-02-19 16:33:45 -0800124 if (gArchUseSIMD) {
125 if (rsdIntrinsicBlend_K(out, in, p->slot, x1, x2) >= 0)
126 return;
127 }
128#endif
Jason Samscf9ea9f2012-09-23 17:00:54 -0700129 switch (p->slot) {
130 case BLEND_CLEAR:
131 for (;x1 < x2; x1++, out++) {
132 *out = 0;
133 }
134 break;
135 case BLEND_SRC:
136 for (;x1 < x2; x1++, out++, in++) {
Tim Murray36889a02012-09-24 14:52:48 -0700137 *out = *in;
Jason Samscf9ea9f2012-09-23 17:00:54 -0700138 }
139 break;
Tim Murray36889a02012-09-24 14:52:48 -0700140 //BLEND_DST is a NOP
Jason Samscf9ea9f2012-09-23 17:00:54 -0700141 case BLEND_DST:
Tim Murray36889a02012-09-24 14:52:48 -0700142 break;
143 case BLEND_SRC_OVER:
Rose, James7b7060c2014-04-22 12:08:06 +0800144 #if defined(ARCH_X86_HAVE_SSSE3)
145 if (gArchUseSIMD) {
146 if ((x1 + 8) < x2) {
147 uint32_t len = (x2 - x1) >> 3;
148 rsdIntrinsicBlendSrcOver_K(out, in, len);
149 x1 += len << 3;
150 out += len << 3;
151 in += len << 3;
152 }
153 }
154 #endif
Jason Samscf9ea9f2012-09-23 17:00:54 -0700155 for (;x1 < x2; x1++, out++, in++) {
Tim Murray36889a02012-09-24 14:52:48 -0700156 short4 in_s = convert_short4(*in);
157 short4 out_s = convert_short4(*out);
Tim Murray0b575de2013-03-15 15:56:43 -0700158 in_s = in_s + ((out_s * (short4)(255 - in_s.w)) >> (short4)8);
Tim Murray36889a02012-09-24 14:52:48 -0700159 *out = convert_uchar4(in_s);
Jason Samscf9ea9f2012-09-23 17:00:54 -0700160 }
161 break;
Tim Murray36889a02012-09-24 14:52:48 -0700162 case BLEND_DST_OVER:
Rose, James7b7060c2014-04-22 12:08:06 +0800163 #if defined(ARCH_X86_HAVE_SSSE3)
164 if (gArchUseSIMD) {
165 if ((x1 + 8) < x2) {
166 uint32_t len = (x2 - x1) >> 3;
167 rsdIntrinsicBlendDstOver_K(out, in, len);
168 x1 += len << 3;
169 out += len << 3;
170 in += len << 3;
171 }
172 }
173 #endif
Tim Murray36889a02012-09-24 14:52:48 -0700174 for (;x1 < x2; x1++, out++, in++) {
175 short4 in_s = convert_short4(*in);
176 short4 out_s = convert_short4(*out);
Tim Murray0b575de2013-03-15 15:56:43 -0700177 in_s = out_s + ((in_s * (short4)(255 - out_s.w)) >> (short4)8);
Tim Murray36889a02012-09-24 14:52:48 -0700178 *out = convert_uchar4(in_s);
179 }
180 break;
181 case BLEND_SRC_IN:
Rose, James7b7060c2014-04-22 12:08:06 +0800182 #if defined(ARCH_X86_HAVE_SSSE3)
183 if (gArchUseSIMD) {
184 if ((x1 + 8) < x2) {
185 uint32_t len = (x2 - x1) >> 3;
186 rsdIntrinsicBlendSrcIn_K(out, in, len);
187 x1 += len << 3;
188 out += len << 3;
189 in += len << 3;
190 }
191 }
192 #endif
Tim Murray36889a02012-09-24 14:52:48 -0700193 for (;x1 < x2; x1++, out++, in++) {
194 short4 in_s = convert_short4(*in);
Tim Murray0b575de2013-03-15 15:56:43 -0700195 in_s = (in_s * out->w) >> (short4)8;
Tim Murray36889a02012-09-24 14:52:48 -0700196 *out = convert_uchar4(in_s);
197 }
198 break;
199 case BLEND_DST_IN:
Rose, James7b7060c2014-04-22 12:08:06 +0800200 #if defined(ARCH_X86_HAVE_SSSE3)
201 if (gArchUseSIMD) {
202 if ((x1 + 8) < x2) {
203 uint32_t len = (x2 - x1) >> 3;
204 rsdIntrinsicBlendDstIn_K(out, in, len);
205 x1 += len << 3;
206 out += len << 3;
207 in += len << 3;
208 }
209 }
210 #endif
Tim Murray36889a02012-09-24 14:52:48 -0700211 for (;x1 < x2; x1++, out++, in++) {
212 short4 out_s = convert_short4(*out);
Tim Murray0b575de2013-03-15 15:56:43 -0700213 out_s = (out_s * in->w) >> (short4)8;
Tim Murray36889a02012-09-24 14:52:48 -0700214 *out = convert_uchar4(out_s);
215 }
216 break;
217 case BLEND_SRC_OUT:
Rose, James7b7060c2014-04-22 12:08:06 +0800218 #if defined(ARCH_X86_HAVE_SSSE3)
219 if (gArchUseSIMD) {
220 if ((x1 + 8) < x2) {
221 uint32_t len = (x2 - x1) >> 3;
222 rsdIntrinsicBlendSrcOut_K(out, in, len);
223 x1 += len << 3;
224 out += len << 3;
225 in += len << 3;
226 }
227 }
228 #endif
Tim Murray36889a02012-09-24 14:52:48 -0700229 for (;x1 < x2; x1++, out++, in++) {
230 short4 in_s = convert_short4(*in);
Tim Murray0b575de2013-03-15 15:56:43 -0700231 in_s = (in_s * (short4)(255 - out->w)) >> (short4)8;
Tim Murray36889a02012-09-24 14:52:48 -0700232 *out = convert_uchar4(in_s);
233 }
234 break;
235 case BLEND_DST_OUT:
Rose, James7b7060c2014-04-22 12:08:06 +0800236 #if defined(ARCH_X86_HAVE_SSSE3)
237 if (gArchUseSIMD) {
238 if ((x1 + 8) < x2) {
239 uint32_t len = (x2 - x1) >> 3;
240 rsdIntrinsicBlendDstOut_K(out, in, len);
241 x1 += len << 3;
242 out += len << 3;
243 in += len << 3;
244 }
245 }
246 #endif
Tim Murray36889a02012-09-24 14:52:48 -0700247 for (;x1 < x2; x1++, out++, in++) {
248 short4 out_s = convert_short4(*out);
Tim Murray0b575de2013-03-15 15:56:43 -0700249 out_s = (out_s * (short4)(255 - in->w)) >> (short4)8;
Tim Murray36889a02012-09-24 14:52:48 -0700250 *out = convert_uchar4(out_s);
251 }
252 break;
253 case BLEND_SRC_ATOP:
Rose, James7b7060c2014-04-22 12:08:06 +0800254 #if defined(ARCH_X86_HAVE_SSSE3)
255 if (gArchUseSIMD) {
256 if ((x1 + 8) < x2) {
257 uint32_t len = (x2 - x1) >> 3;
258 rsdIntrinsicBlendSrcAtop_K(out, in, len);
259 x1 += len << 3;
260 out += len << 3;
261 in += len << 3;
262 }
263 }
264 #endif
Tim Murray36889a02012-09-24 14:52:48 -0700265 for (;x1 < x2; x1++, out++, in++) {
266 short4 in_s = convert_short4(*in);
267 short4 out_s = convert_short4(*out);
Tim Murray0b575de2013-03-15 15:56:43 -0700268 out_s.xyz = ((in_s.xyz * out_s.w) +
269 (out_s.xyz * ((short3)255 - (short3)in_s.w))) >> (short3)8;
Tim Murray36889a02012-09-24 14:52:48 -0700270 *out = convert_uchar4(out_s);
271 }
272 break;
273 case BLEND_DST_ATOP:
Rose, James7b7060c2014-04-22 12:08:06 +0800274 #if defined(ARCH_X86_HAVE_SSSE3)
275 if (gArchUseSIMD) {
276 if ((x1 + 8) < x2) {
277 uint32_t len = (x2 - x1) >> 3;
278 rsdIntrinsicBlendDstAtop_K(out, in, len);
279 x1 += len << 3;
280 out += len << 3;
281 in += len << 3;
282 }
283 }
284 #endif
Tim Murray36889a02012-09-24 14:52:48 -0700285 for (;x1 < x2; x1++, out++, in++) {
286 short4 in_s = convert_short4(*in);
287 short4 out_s = convert_short4(*out);
Tim Murray0b575de2013-03-15 15:56:43 -0700288 out_s.xyz = ((out_s.xyz * in_s.w) +
289 (in_s.xyz * ((short3)255 - (short3)out_s.w))) >> (short3)8;
Tim Murray36889a02012-09-24 14:52:48 -0700290 *out = convert_uchar4(out_s);
291 }
292 break;
293 case BLEND_XOR:
Rose, James7b7060c2014-04-22 12:08:06 +0800294 #if defined(ARCH_X86_HAVE_SSSE3)
295 if (gArchUseSIMD) {
296 if ((x1 + 8) < x2) {
297 uint32_t len = (x2 - x1) >> 3;
298 rsdIntrinsicBlendXor_K(out, in, len);
299 x1 += len << 3;
300 out += len << 3;
301 in += len << 3;
302 }
303 }
304 #endif
Tim Murray36889a02012-09-24 14:52:48 -0700305 for (;x1 < x2; x1++, out++, in++) {
306 *out = *in ^ *out;
307 }
308 break;
309 case BLEND_NORMAL:
310 ALOGE("Called unimplemented blend intrinsic BLEND_NORMAL");
311 rsAssert(false);
312 break;
313 case BLEND_AVERAGE:
314 ALOGE("Called unimplemented blend intrinsic BLEND_AVERAGE");
315 rsAssert(false);
316 break;
317 case BLEND_MULTIPLY:
Rose, James7b7060c2014-04-22 12:08:06 +0800318 #if defined(ARCH_X86_HAVE_SSSE3)
319 if (gArchUseSIMD) {
320 if ((x1 + 8) < x2) {
321 uint32_t len = (x2 - x1) >> 3;
322 rsdIntrinsicBlendMultiply_K(out, in, len);
323 x1 += len << 3;
324 out += len << 3;
325 in += len << 3;
326 }
327 }
328 #endif
Tim Murray36889a02012-09-24 14:52:48 -0700329 for (;x1 < x2; x1++, out++, in++) {
330 *out = convert_uchar4((convert_short4(*in) * convert_short4(*out))
331 >> (short4)8);
332 }
333 break;
334 case BLEND_SCREEN:
335 ALOGE("Called unimplemented blend intrinsic BLEND_SCREEN");
336 rsAssert(false);
337 break;
338 case BLEND_DARKEN:
339 ALOGE("Called unimplemented blend intrinsic BLEND_DARKEN");
340 rsAssert(false);
341 break;
342 case BLEND_LIGHTEN:
343 ALOGE("Called unimplemented blend intrinsic BLEND_LIGHTEN");
344 rsAssert(false);
345 break;
346 case BLEND_OVERLAY:
347 ALOGE("Called unimplemented blend intrinsic BLEND_OVERLAY");
348 rsAssert(false);
349 break;
350 case BLEND_HARDLIGHT:
351 ALOGE("Called unimplemented blend intrinsic BLEND_HARDLIGHT");
352 rsAssert(false);
353 break;
354 case BLEND_SOFTLIGHT:
355 ALOGE("Called unimplemented blend intrinsic BLEND_SOFTLIGHT");
356 rsAssert(false);
357 break;
358 case BLEND_DIFFERENCE:
359 ALOGE("Called unimplemented blend intrinsic BLEND_DIFFERENCE");
360 rsAssert(false);
361 break;
362 case BLEND_NEGATION:
363 ALOGE("Called unimplemented blend intrinsic BLEND_NEGATION");
364 rsAssert(false);
365 break;
366 case BLEND_EXCLUSION:
367 ALOGE("Called unimplemented blend intrinsic BLEND_EXCLUSION");
368 rsAssert(false);
369 break;
370 case BLEND_COLOR_DODGE:
371 ALOGE("Called unimplemented blend intrinsic BLEND_COLOR_DODGE");
372 rsAssert(false);
373 break;
374 case BLEND_INVERSE_COLOR_DODGE:
375 ALOGE("Called unimplemented blend intrinsic BLEND_INVERSE_COLOR_DODGE");
376 rsAssert(false);
377 break;
378 case BLEND_SOFT_DODGE:
379 ALOGE("Called unimplemented blend intrinsic BLEND_SOFT_DODGE");
380 rsAssert(false);
381 break;
382 case BLEND_COLOR_BURN:
383 ALOGE("Called unimplemented blend intrinsic BLEND_COLOR_BURN");
384 rsAssert(false);
385 break;
386 case BLEND_INVERSE_COLOR_BURN:
387 ALOGE("Called unimplemented blend intrinsic BLEND_INVERSE_COLOR_BURN");
388 rsAssert(false);
389 break;
390 case BLEND_SOFT_BURN:
391 ALOGE("Called unimplemented blend intrinsic BLEND_SOFT_BURN");
392 rsAssert(false);
393 break;
394 case BLEND_REFLECT:
395 ALOGE("Called unimplemented blend intrinsic BLEND_REFLECT");
396 rsAssert(false);
397 break;
398 case BLEND_GLOW:
399 ALOGE("Called unimplemented blend intrinsic BLEND_GLOW");
400 rsAssert(false);
401 break;
402 case BLEND_FREEZE:
403 ALOGE("Called unimplemented blend intrinsic BLEND_FREEZE");
404 rsAssert(false);
405 break;
406 case BLEND_HEAT:
407 ALOGE("Called unimplemented blend intrinsic BLEND_HEAT");
408 rsAssert(false);
409 break;
410 case BLEND_ADD:
Rose, James7b7060c2014-04-22 12:08:06 +0800411 #if defined(ARCH_X86_HAVE_SSSE3)
412 if (gArchUseSIMD) {
413 if((x1 + 8) < x2) {
414 uint32_t len = (x2 - x1) >> 3;
415 rsdIntrinsicBlendAdd_K(out, in, len);
416 x1 += len << 3;
417 out += len << 3;
418 in += len << 3;
419 }
420 }
421 #endif
Tim Murray36889a02012-09-24 14:52:48 -0700422 for (;x1 < x2; x1++, out++, in++) {
Tim Murray0b575de2013-03-15 15:56:43 -0700423 uint32_t iR = in->x, iG = in->y, iB = in->z, iA = in->w,
424 oR = out->x, oG = out->y, oB = out->z, oA = out->w;
425 out->x = (oR + iR) > 255 ? 255 : oR + iR;
426 out->y = (oG + iG) > 255 ? 255 : oG + iG;
427 out->z = (oB + iB) > 255 ? 255 : oB + iB;
428 out->w = (oA + iA) > 255 ? 255 : oA + iA;
Tim Murray36889a02012-09-24 14:52:48 -0700429 }
430 break;
431 case BLEND_SUBTRACT:
Rose, James7b7060c2014-04-22 12:08:06 +0800432 #if defined(ARCH_X86_HAVE_SSSE3)
433 if (gArchUseSIMD) {
434 if((x1 + 8) < x2) {
435 uint32_t len = (x2 - x1) >> 3;
436 rsdIntrinsicBlendSub_K(out, in, len);
437 x1 += len << 3;
438 out += len << 3;
439 in += len << 3;
440 }
441 }
442 #endif
Tim Murray36889a02012-09-24 14:52:48 -0700443 for (;x1 < x2; x1++, out++, in++) {
Tim Murray0b575de2013-03-15 15:56:43 -0700444 int32_t iR = in->x, iG = in->y, iB = in->z, iA = in->w,
445 oR = out->x, oG = out->y, oB = out->z, oA = out->w;
446 out->x = (oR - iR) < 0 ? 0 : oR - iR;
447 out->y = (oG - iG) < 0 ? 0 : oG - iG;
448 out->z = (oB - iB) < 0 ? 0 : oB - iB;
449 out->w = (oA - iA) < 0 ? 0 : oA - iA;
Tim Murray36889a02012-09-24 14:52:48 -0700450 }
451 break;
452 case BLEND_STAMP:
453 ALOGE("Called unimplemented blend intrinsic BLEND_STAMP");
454 rsAssert(false);
455 break;
456 case BLEND_RED:
457 ALOGE("Called unimplemented blend intrinsic BLEND_RED");
458 rsAssert(false);
459 break;
460 case BLEND_GREEN:
461 ALOGE("Called unimplemented blend intrinsic BLEND_GREEN");
462 rsAssert(false);
463 break;
464 case BLEND_BLUE:
465 ALOGE("Called unimplemented blend intrinsic BLEND_BLUE");
466 rsAssert(false);
467 break;
468 case BLEND_HUE:
469 ALOGE("Called unimplemented blend intrinsic BLEND_HUE");
470 rsAssert(false);
471 break;
472 case BLEND_SATURATION:
473 ALOGE("Called unimplemented blend intrinsic BLEND_SATURATION");
474 rsAssert(false);
475 break;
476 case BLEND_COLOR:
477 ALOGE("Called unimplemented blend intrinsic BLEND_COLOR");
478 rsAssert(false);
479 break;
480 case BLEND_LUMINOSITY:
481 ALOGE("Called unimplemented blend intrinsic BLEND_LUMINOSITY");
482 rsAssert(false);
483 break;
Jason Samscf9ea9f2012-09-23 17:00:54 -0700484
Tim Murray36889a02012-09-24 14:52:48 -0700485 default:
486 ALOGE("Called unimplemented value %d", p->slot);
487 rsAssert(false);
Jason Samscf9ea9f2012-09-23 17:00:54 -0700488
489 }
Jason Samscf9ea9f2012-09-23 17:00:54 -0700490}
491
Jason Samscf9ea9f2012-09-23 17:00:54 -0700492
Jason Samsc905efd2012-11-26 15:20:18 -0800493RsdCpuScriptIntrinsicBlend::RsdCpuScriptIntrinsicBlend(RsdCpuReferenceImpl *ctx,
494 const Script *s, const Element *e)
495 : RsdCpuScriptIntrinsic(ctx, s, e, RS_SCRIPT_INTRINSIC_ID_BLEND) {
Jason Samscf9ea9f2012-09-23 17:00:54 -0700496
Jason Sams709a0972012-11-15 18:18:04 -0800497 mRootPtr = &kernel;
Jason Samscf9ea9f2012-09-23 17:00:54 -0700498}
499
Jason Sams709a0972012-11-15 18:18:04 -0800500RsdCpuScriptIntrinsicBlend::~RsdCpuScriptIntrinsicBlend() {
501}
502
503void RsdCpuScriptIntrinsicBlend::populateScript(Script *s) {
504 s->mHal.info.exportedVariableCount = 0;
505}
506
Jason Samsc905efd2012-11-26 15:20:18 -0800507RsdCpuScriptImpl * rsdIntrinsic_Blend(RsdCpuReferenceImpl *ctx,
508 const Script *s, const Element *e) {
509 return new RsdCpuScriptIntrinsicBlend(ctx, s, e);
Jason Sams709a0972012-11-15 18:18:04 -0800510}