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 blitter->~SkRasterPipelineBlitter(); | 102 alloc->deleteLast(); |
103 alloc->freeLast(); | |
104 return nullptr; | 103 return nullptr; |
105 }; | 104 }; |
106 | 105 |
107 SkBlendMode* blend = &blitter->fBlend; | 106 SkBlendMode* blend = &blitter->fBlend; |
108 SkPM4f* paintColor = &blitter->fPaintColor; | 107 SkPM4f* paintColor = &blitter->fPaintColor; |
109 SkRasterPipeline* pipeline = &blitter->fShader; | 108 SkRasterPipeline* pipeline = &blitter->fShader; |
110 | 109 |
111 SkShader* shader = paint.getShader(); | 110 SkShader* shader = paint.getShader(); |
112 SkColorFilter* colorFilter = paint.getColorFilter(); | 111 SkColorFilter* colorFilter = paint.getColorFilter(); |
113 | 112 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 case SkMask::kLCD16_Format: | 292 case SkMask::kLCD16_Format: |
294 fMaskPtr = mask.getAddrLCD16(x,y)-x; | 293 fMaskPtr = mask.getAddrLCD16(x,y)-x; |
295 fBlitMaskLCD16(x, clip.width()); | 294 fBlitMaskLCD16(x, clip.width()); |
296 break; | 295 break; |
297 default: | 296 default: |
298 // TODO | 297 // TODO |
299 break; | 298 break; |
300 } | 299 } |
301 } | 300 } |
302 } | 301 } |
OLD | NEW |