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

Side by Side Diff: src/core/SkLinearBitmapPipeline_sample.h

Issue 1888883003: add index in getPixels for F16 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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 2016 Google Inc. 2 * Copyright 2016 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 SkLinearBitmapPipeline_sampler_DEFINED 8 #ifndef SkLinearBitmapPipeline_sampler_DEFINED
9 #define SkLinearBitmapPipeline_sampler_DEFINED 9 #define SkLinearBitmapPipeline_sampler_DEFINED
10 10
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 770
771 void get4Pixels(const void* vsrc, int index, Sk4f* px0, Sk4f* px1, Sk4f* px2 , Sk4f* px3) { 771 void get4Pixels(const void* vsrc, int index, Sk4f* px0, Sk4f* px1, Sk4f* px2 , Sk4f* px3) {
772 const uint32_t* src = static_cast<const uint32_t*>(vsrc); 772 const uint32_t* src = static_cast<const uint32_t*>(vsrc);
773 *px0 = this->getPixelAt(src, index + 0); 773 *px0 = this->getPixelAt(src, index + 0);
774 *px1 = this->getPixelAt(src, index + 1); 774 *px1 = this->getPixelAt(src, index + 1);
775 *px2 = this->getPixelAt(src, index + 2); 775 *px2 = this->getPixelAt(src, index + 2);
776 *px3 = this->getPixelAt(src, index + 3); 776 *px3 = this->getPixelAt(src, index + 3);
777 } 777 }
778 778
779 Sk4f getPixelAt(const void* vsrc, int index) { 779 Sk4f getPixelAt(const void* vsrc, int index) {
780 const uint64_t* src = static_cast<const uint64_t*>(vsrc); 780 const uint64_t* src = static_cast<const uint64_t*>(vsrc) + index;
781 return SkHalfToFloat_01(*src); 781 return SkHalfToFloat_01(*src);
782 } 782 }
783 783
784 const void* row(int y) { return fSrc + y * fWidth[0]; } 784 const void* row(int y) { return fSrc + y * fWidth[0]; }
785 785
786 private: 786 private:
787 const uint64_t* const fSrc; 787 const uint64_t* const fSrc;
788 const Sk4i fWidth; 788 const Sk4i fWidth;
789 }; 789 };
790 790
791 } // namespace 791 } // namespace
792 792
793 #endif // SkLinearBitmapPipeline_sampler_DEFINED 793 #endif // SkLinearBitmapPipeline_sampler_DEFINED
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698