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

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

Issue 1832223002: switch xfermodes over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "SkBitmapProcShader.h" 8 #include "SkBitmapProcShader.h"
9 #include "SkBitmapProcState.h" 9 #include "SkBitmapProcState.h"
10 #include "SkBitmapProvider.h" 10 #include "SkBitmapProvider.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 fPipeline = (SkLinearBitmapPipeline*)SkAlign16((intptr_t)fStorage); 125 fPipeline = (SkLinearBitmapPipeline*)SkAlign16((intptr_t)fStorage);
126 float alpha = SkColorGetA(info->fPaintColor) / 255.0f; 126 float alpha = SkColorGetA(info->fPaintColor) / 255.0f;
127 new (fPipeline) SkLinearBitmapPipeline(info->fRealInvMatrix, info->fFilt erQuality, 127 new (fPipeline) SkLinearBitmapPipeline(info->fRealInvMatrix, info->fFilt erQuality,
128 info->fTileModeX, info->fTileMode Y, 128 info->fTileModeX, info->fTileMode Y,
129 alpha, 129 alpha,
130 info->fPixmap); 130 info->fPixmap);
131 131
132 // To implement the old shadeSpan entry-point, we need to efficiently co nvert our native 132 // To implement the old shadeSpan entry-point, we need to efficiently co nvert our native
133 // floats into SkPMColor. The SkXfermode::D32Procs do exactly that. 133 // floats into SkPMColor. The SkXfermode::D32Procs do exactly that.
134 // 134 //
135 sk_sp<SkXfermode> xfer(SkXfermode::Create(SkXfermode::kSrc_Mode)); 135 sk_sp<SkXfermode> xfer(SkXfermode::Make(SkXfermode::kSrc_Mode));
136 fXferProc = SkXfermode::GetD32Proc(xfer.get(), 0); 136 fXferProc = SkXfermode::GetD32Proc(xfer.get(), 0);
137 } 137 }
138 138
139 ~LinearPipelineContext() override { 139 ~LinearPipelineContext() override {
140 // since we did a manual new, we need to manually destroy as well. 140 // since we did a manual new, we need to manually destroy as well.
141 fPipeline->~SkLinearBitmapPipeline(); 141 fPipeline->~SkLinearBitmapPipeline();
142 } 142 }
143 143
144 void shadeSpan4f(int x, int y, SkPM4f dstC[], int count) override { 144 void shadeSpan4f(int x, int y, SkPM4f dstC[], int count) override {
145 fPipeline->shadeSpan4f(x, y, dstC, count); 145 fPipeline->shadeSpan4f(x, y, dstC, count);
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params)); 454 inner.reset(GrSimpleTextureEffect::Create(texture, matrix, params));
455 } 455 }
456 456
457 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) { 457 if (kAlpha_8_SkColorType == fRawBitmap.colorType()) {
458 return GrFragmentProcessor::MulOutputByInputUnpremulColor(inner); 458 return GrFragmentProcessor::MulOutputByInputUnpremulColor(inner);
459 } 459 }
460 return GrFragmentProcessor::MulOutputByInputAlpha(inner); 460 return GrFragmentProcessor::MulOutputByInputAlpha(inner);
461 } 461 }
462 462
463 #endif 463 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698