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

Side by Side Diff: experimental/skpdiff/SkCLImageDiffer.h

Issue 19374006: make OpenCL optional for skpdiff (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: comments 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
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 #ifndef SkCLImageDiffer_DEFINED 8 #ifndef SkCLImageDiffer_DEFINED
9 #define SkCLImageDiffer_DEFINED 9 #define SkCLImageDiffer_DEFINED
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 cl_device_id fDevice; 79 cl_device_id fDevice;
80 cl_context fContext; 80 cl_context fContext;
81 cl_command_queue fCommandQueue; 81 cl_command_queue fCommandQueue;
82 82
83 private: 83 private:
84 84
85 typedef SkImageDiffer INHERITED; 85 typedef SkImageDiffer INHERITED;
86 }; 86 };
87 87
88 /**
89 * A OpenCL differ that measures the percentage of different corresponding pixel s. If the two images
90 * are not the same size or have no pixels, the result will always be zero.
91 */
92 class SkDifferentPixelsImageDiffer : public SkCLImageDiffer {
93 public:
94 virtual const char* getName() SK_OVERRIDE;
95 virtual int queueDiff(SkBitmap* baseline, SkBitmap* test) SK_OVERRIDE;
96 virtual void deleteDiff(int id) SK_OVERRIDE;
97 virtual bool isFinished(int id) SK_OVERRIDE;
98 virtual double getResult(int id) SK_OVERRIDE;
99 virtual int getPointsOfInterestCount(int id) SK_OVERRIDE;
100 virtual SkIPoint* getPointsOfInterest(int id) SK_OVERRIDE;
101
102 protected:
103 virtual bool onInit() SK_OVERRIDE;
104
105 private:
106 struct QueuedDiff;
107
108 SkTDArray<QueuedDiff> fQueuedDiffs;
109 cl_kernel fKernel;
110
111 typedef SkCLImageDiffer INHERITED;
112 };
113
114 #endif 88 #endif
OLDNEW
« no previous file with comments | « no previous file | experimental/skpdiff/SkCLImageDiffer.cpp » ('j') | experimental/skpdiff/SkDifferentPixelsMetric.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698