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

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

Issue 2494353002: Revert of Make SkSmallAllocator obey the RAII invariants and be expandable (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « src/core/SkDrawLooper.cpp ('k') | src/core/SkSmallAllocator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkDrawLooper.cpp ('k') | src/core/SkSmallAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698