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 alloc->deleteLast(); | 96 blitter->~SkRasterPipelineBlitter(); |
| 97 alloc->freeLast(); |
97 return nullptr; | 98 return nullptr; |
98 }; | 99 }; |
99 | 100 |
100 SkBlendMode* blend = &blitter->fBlend; | 101 SkBlendMode* blend = &blitter->fBlend; |
101 SkPM4f* paintColor = &blitter->fPaintColor; | 102 SkPM4f* paintColor = &blitter->fPaintColor; |
102 SkRasterPipeline* pipeline = &blitter->fShader; | 103 SkRasterPipeline* pipeline = &blitter->fShader; |
103 | 104 |
104 SkShader* shader = paint.getShader(); | 105 SkShader* shader = paint.getShader(); |
105 SkColorFilter* colorFilter = paint.getColorFilter(); | 106 SkColorFilter* colorFilter = paint.getColorFilter(); |
106 | 107 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 case SkMask::kLCD16_Format: | 288 case SkMask::kLCD16_Format: |
288 fMaskPtr = mask.getAddrLCD16(x,y)-x; | 289 fMaskPtr = mask.getAddrLCD16(x,y)-x; |
289 fBlitMaskLCD16(x, clip.width()); | 290 fBlitMaskLCD16(x, clip.width()); |
290 break; | 291 break; |
291 default: | 292 default: |
292 // TODO | 293 // TODO |
293 break; | 294 break; |
294 } | 295 } |
295 } | 296 } |
296 } | 297 } |
OLD | NEW |