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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 return color.premul(); | 92 return color.premul(); |
93 } | 93 } |
94 | 94 |
95 SkBlitter* SkRasterPipelineBlitter::Create(const SkPixmap& dst, | 95 SkBlitter* SkRasterPipelineBlitter::Create(const SkPixmap& dst, |
96 const SkPaint& paint, | 96 const SkPaint& paint, |
97 SkTBlitterAllocator* alloc) { | 97 SkTBlitterAllocator* alloc) { |
98 auto blitter = alloc->createT<SkRasterPipelineBlitter>(dst, | 98 auto blitter = alloc->createT<SkRasterPipelineBlitter>(dst, |
99 paint.getBlendMode(), | 99 paint.getBlendMode(), |
100 paint_color(dst, pain
t)); | 100 paint_color(dst, pain
t)); |
101 auto earlyOut = [&] { | 101 auto earlyOut = [&] { |
102 alloc->deleteLast(); | 102 blitter->~SkRasterPipelineBlitter(); |
| 103 alloc->freeLast(); |
103 return nullptr; | 104 return nullptr; |
104 }; | 105 }; |
105 | 106 |
106 SkBlendMode* blend = &blitter->fBlend; | 107 SkBlendMode* blend = &blitter->fBlend; |
107 SkPM4f* paintColor = &blitter->fPaintColor; | 108 SkPM4f* paintColor = &blitter->fPaintColor; |
108 SkRasterPipeline* pipeline = &blitter->fShader; | 109 SkRasterPipeline* pipeline = &blitter->fShader; |
109 | 110 |
110 SkShader* shader = paint.getShader(); | 111 SkShader* shader = paint.getShader(); |
111 SkColorFilter* colorFilter = paint.getColorFilter(); | 112 SkColorFilter* colorFilter = paint.getColorFilter(); |
112 | 113 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 case SkMask::kLCD16_Format: | 293 case SkMask::kLCD16_Format: |
293 fMaskPtr = mask.getAddrLCD16(x,y)-x; | 294 fMaskPtr = mask.getAddrLCD16(x,y)-x; |
294 fBlitMaskLCD16(x, clip.width()); | 295 fBlitMaskLCD16(x, clip.width()); |
295 break; | 296 break; |
296 default: | 297 default: |
297 // TODO | 298 // TODO |
298 break; | 299 break; |
299 } | 300 } |
300 } | 301 } |
301 } | 302 } |
OLD | NEW |