Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: experimental/skpdiff/diff_pixels.cl

Issue 18176005: add point of interest API (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: constant zero buffer Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « experimental/skpdiff/SkPMetric.cpp ('k') | experimental/skpdiff/main.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #pragma OPENCL_EXTENSION cl_khr_global_int32_base_atomics 8 #pragma OPENCL_EXTENSION cl_khr_global_int32_base_atomics
9 9
10 const sampler_t gInSampler = CLK_NORMALIZED_COORDS_FALSE | 10 const sampler_t gInSampler = CLK_NORMALIZED_COORDS_FALSE |
11 CLK_ADDRESS_CLAMP_TO_EDGE | 11 CLK_ADDRESS_CLAMP_TO_EDGE |
12 CLK_FILTER_NEAREST; 12 CLK_FILTER_NEAREST;
13 13
14 __kernel void diff(read_only image2d_t baseline, read_only image2d_t test, __glo bal int* result) { 14 __kernel void diff(read_only image2d_t baseline, read_only image2d_t test,
15 __global int* result, __global int2* poi) {
15 int2 coord = (int2)(get_global_id(0), get_global_id(1)); 16 int2 coord = (int2)(get_global_id(0), get_global_id(1));
16 uint4 baselinePixel = read_imageui(baseline, gInSampler, coord); 17 uint4 baselinePixel = read_imageui(baseline, gInSampler, coord);
17 uint4 testPixel = read_imageui(test, gInSampler, coord); 18 uint4 testPixel = read_imageui(test, gInSampler, coord);
18 int4 pixelCompare = baselinePixel == testPixel; 19 int4 pixelCompare = baselinePixel == testPixel;
19 if (baselinePixel.x != testPixel.x || 20 if (baselinePixel.x != testPixel.x ||
20 baselinePixel.y != testPixel.y || 21 baselinePixel.y != testPixel.y ||
21 baselinePixel.z != testPixel.z || 22 baselinePixel.z != testPixel.z ||
22 baselinePixel.w != testPixel.w) { 23 baselinePixel.w != testPixel.w) {
23 24
24 atom_inc(result); 25 int poiIndex = atomic_inc(result);
26 poi[poiIndex] = coord;
25 } 27 }
26 } 28 }
OLDNEW
« no previous file with comments | « experimental/skpdiff/SkPMetric.cpp ('k') | experimental/skpdiff/main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698