OLD | NEW |
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 "SkBlitter.h" | 8 #include "SkBlitter.h" |
9 #include "SkBlendModePriv.h" | 9 #include "SkBlendModePriv.h" |
10 #include "SkColor.h" | 10 #include "SkColor.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 SkBlitter* SkRasterPipelineBlitter::Create(const SkPixmap& dst, | 87 SkBlitter* SkRasterPipelineBlitter::Create(const SkPixmap& dst, |
88 const SkPaint& paint, | 88 const SkPaint& paint, |
89 SkTBlitterAllocator* alloc) { | 89 SkTBlitterAllocator* alloc) { |
90 auto blitter = alloc->createT<SkRasterPipelineBlitter>( | 90 auto blitter = alloc->createT<SkRasterPipelineBlitter>( |
91 dst, | 91 dst, |
92 paint.getBlendMode(), | 92 paint.getBlendMode(), |
93 SkPM4f_from_SkColor(paint.getColor(), dst.colorSpace())); | 93 SkPM4f_from_SkColor(paint.getColor(), dst.colorSpace())); |
94 | 94 |
95 auto earlyOut = [&] { | 95 auto earlyOut = [&] { |
96 blitter->~SkRasterPipelineBlitter(); | 96 alloc->deleteLast(); |
97 alloc->freeLast(); | |
98 return nullptr; | 97 return nullptr; |
99 }; | 98 }; |
100 | 99 |
101 SkBlendMode* blend = &blitter->fBlend; | 100 SkBlendMode* blend = &blitter->fBlend; |
102 SkPM4f* paintColor = &blitter->fPaintColor; | 101 SkPM4f* paintColor = &blitter->fPaintColor; |
103 SkRasterPipeline* pipeline = &blitter->fShader; | 102 SkRasterPipeline* pipeline = &blitter->fShader; |
104 | 103 |
105 SkShader* shader = paint.getShader(); | 104 SkShader* shader = paint.getShader(); |
106 SkColorFilter* colorFilter = paint.getColorFilter(); | 105 SkColorFilter* colorFilter = paint.getColorFilter(); |
107 | 106 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 case SkMask::kLCD16_Format: | 288 case SkMask::kLCD16_Format: |
290 fMaskPtr = mask.getAddrLCD16(x,y)-x; | 289 fMaskPtr = mask.getAddrLCD16(x,y)-x; |
291 fBlitMaskLCD16(x, clip.width()); | 290 fBlitMaskLCD16(x, clip.width()); |
292 break; | 291 break; |
293 default: | 292 default: |
294 // TODO | 293 // TODO |
295 break; | 294 break; |
296 } | 295 } |
297 } | 296 } |
298 } | 297 } |
OLD | NEW |