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

Side by Side Diff: tools/skpdiff/SkCLImageDiffer.cpp

Issue 60833002: fix multithread related crashes in skpdiff (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: addressing comments Created 7 years, 1 month 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
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 #include <cstring> 8 #include <cstring>
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 cl_int kernelErr; 77 cl_int kernelErr;
78 *kernel = clCreateKernel(program, name, &kernelErr); 78 *kernel = clCreateKernel(program, name, &kernelErr);
79 if (CL_SUCCESS != kernelErr) { 79 if (CL_SUCCESS != kernelErr) {
80 SkDebugf("Kernel creation failed: %s\n", cl_error_to_string(kernelErr)); 80 SkDebugf("Kernel creation failed: %s\n", cl_error_to_string(kernelErr));
81 return false; 81 return false;
82 } 82 }
83 83
84 return true; 84 return true;
85 } 85 }
86 86
87 bool SkCLImageDiffer::makeImage2D(SkBitmap* bitmap, cl_mem* image) { 87 bool SkCLImageDiffer::makeImage2D(SkBitmap* bitmap, cl_mem* image) const {
88 cl_int imageErr; 88 cl_int imageErr;
89 cl_image_format bitmapFormat; 89 cl_image_format bitmapFormat;
90 switch (bitmap->config()) { 90 switch (bitmap->config()) {
91 case SkBitmap::kA8_Config: 91 case SkBitmap::kA8_Config:
92 bitmapFormat.image_channel_order = CL_A; 92 bitmapFormat.image_channel_order = CL_A;
93 bitmapFormat.image_channel_data_type = CL_UNSIGNED_INT8; 93 bitmapFormat.image_channel_data_type = CL_UNSIGNED_INT8;
94 break; 94 break;
95 case SkBitmap::kRGB_565_Config: 95 case SkBitmap::kRGB_565_Config:
96 bitmapFormat.image_channel_order = CL_RGB; 96 bitmapFormat.image_channel_order = CL_RGB;
97 bitmapFormat.image_channel_data_type = CL_UNORM_SHORT_565; 97 bitmapFormat.image_channel_data_type = CL_UNORM_SHORT_565;
(...skipping 15 matching lines...) Expand all
113 &imageErr); 113 &imageErr);
114 bitmap->unlockPixels(); 114 bitmap->unlockPixels();
115 115
116 if (CL_SUCCESS != imageErr) { 116 if (CL_SUCCESS != imageErr) {
117 SkDebugf("Input image creation failed: %s\n", cl_error_to_string(imageEr r)); 117 SkDebugf("Input image creation failed: %s\n", cl_error_to_string(imageEr r));
118 return false; 118 return false;
119 } 119 }
120 120
121 return true; 121 return true;
122 } 122 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698