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

Side by Side Diff: src/core/SkLinearBitmapPipeline.cpp

Issue 2486523002: Change code to not store Sk4* in data structures. (Closed)
Patch Set: Address comments 2 Created 4 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
« no previous file with comments | « src/core/SkLinearBitmapPipeline.h ('k') | src/core/SkLinearBitmapPipeline_matrix.h » ('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 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 #include "SkLinearBitmapPipeline.h" 8 #include "SkLinearBitmapPipeline.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 newPixel = newPixel * fPostAlpha; 590 newPixel = newPixel * fPostAlpha;
591 newPixel.store(dst + index); 591 newPixel.store(dst + index);
592 } 592 }
593 static Sk4f SK_VECTORCALL Premultiply(Sk4f pixel) { 593 static Sk4f SK_VECTORCALL Premultiply(Sk4f pixel) {
594 float alpha = pixel[3]; 594 float alpha = pixel[3];
595 return pixel * Sk4f{alpha, alpha, alpha, 1.0f}; 595 return pixel * Sk4f{alpha, alpha, alpha, 1.0f};
596 } 596 }
597 597
598 SkPM4f* fDst; 598 SkPM4f* fDst;
599 SkPM4f* fEnd; 599 SkPM4f* fEnd;
600 Sk4f fPostAlpha; 600 float fPostAlpha;
601 }; 601 };
602 602
603 static SkLinearBitmapPipeline::BlendProcessorInterface* choose_blender_for_shadi ng( 603 static SkLinearBitmapPipeline::BlendProcessorInterface* choose_blender_for_shadi ng(
604 SkAlphaType alphaType, 604 SkAlphaType alphaType,
605 float postAlpha, 605 float postAlpha,
606 SkLinearBitmapPipeline::BlenderStage* blenderStage) { 606 SkLinearBitmapPipeline::BlenderStage* blenderStage) {
607 if (alphaType == kUnpremul_SkAlphaType) { 607 if (alphaType == kUnpremul_SkAlphaType) {
608 blenderStage->initSink<SrcFPPixel<kUnpremul_SkAlphaType>>(postAlpha); 608 blenderStage->initSink<SrcFPPixel<kUnpremul_SkAlphaType>>(postAlpha);
609 } else { 609 } else {
610 // kOpaque_SkAlphaType is treated the same as kPremul_SkAlphaType 610 // kOpaque_SkAlphaType is treated the same as kPremul_SkAlphaType
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 void SkLinearBitmapPipeline::blitSpan(int x, int y, void* dst, int count) { 734 void SkLinearBitmapPipeline::blitSpan(int x, int y, void* dst, int count) {
735 SkASSERT(count > 0); 735 SkASSERT(count > 0);
736 fLastStage->setDestination(dst, count); 736 fLastStage->setDestination(dst, count);
737 737
738 // The count and length arguments start out in a precise relation in order t o keep the 738 // The count and length arguments start out in a precise relation in order t o keep the
739 // math correct through the different stages. Count is the number of pixel t o produce. 739 // math correct through the different stages. Count is the number of pixel t o produce.
740 // Since the code samples at pixel centers, length is the distance from the center of the 740 // Since the code samples at pixel centers, length is the distance from the center of the
741 // first pixel to the center of the last pixel. This implies that length is count-1. 741 // first pixel to the center of the last pixel. This implies that length is count-1.
742 fFirstStage->pointSpan(Span{{x + 0.5f, y + 0.5f}, count - 1.0f, count}); 742 fFirstStage->pointSpan(Span{{x + 0.5f, y + 0.5f}, count - 1.0f, count});
743 } 743 }
OLDNEW
« no previous file with comments | « src/core/SkLinearBitmapPipeline.h ('k') | src/core/SkLinearBitmapPipeline_matrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698