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

Side by Side Diff: src/effects/SkLayerRasterizer.cpp

Issue 285443002: Remove SkLayerRasterizer legacy code. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up gyp files Created 6 years, 7 months 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
« gyp/common_conditions.gypi ('K') | « src/core/SkPaintPriv.cpp ('k') | no next file » | 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkLayerRasterizer.h" 10 #include "SkLayerRasterizer.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 rec->fPaint.~SkPaint(); 43 rec->fPaint.~SkPaint();
44 44
45 SkDELETE(layers); 45 SkDELETE(layers);
46 } 46 }
47 47
48 SkLayerRasterizer::~SkLayerRasterizer() { 48 SkLayerRasterizer::~SkLayerRasterizer() {
49 SkASSERT(fLayers); 49 SkASSERT(fLayers);
50 clean_up_layers(const_cast<SkDeque*>(fLayers)); 50 clean_up_layers(const_cast<SkDeque*>(fLayers));
51 } 51 }
52 52
53 #ifdef SK_SUPPORT_LEGACY_LAYERRASTERIZER_API
54 void SkLayerRasterizer::addLayer(const SkPaint& paint, SkScalar dx,
55 SkScalar dy) {
56 SkASSERT(fLayers);
57 SkLayerRasterizer_Rec* rec = (SkLayerRasterizer_Rec*)fLayers->push_back();
58
59 SkNEW_PLACEMENT_ARGS(&rec->fPaint, SkPaint, (paint));
60 rec->fOffset.set(dx, dy);
61 }
62 #endif
63
64 static bool compute_bounds(const SkDeque& layers, const SkPath& path, 53 static bool compute_bounds(const SkDeque& layers, const SkPath& path,
65 const SkMatrix& matrix, 54 const SkMatrix& matrix,
66 const SkIRect* clipBounds, SkIRect* bounds) { 55 const SkIRect* clipBounds, SkIRect* bounds) {
67 SkDeque::F2BIter iter(layers); 56 SkDeque::F2BIter iter(layers);
68 SkLayerRasterizer_Rec* rec; 57 SkLayerRasterizer_Rec* rec;
69 58
70 bounds->set(SK_MaxS32, SK_MaxS32, SK_MinS32, SK_MinS32); 59 bounds->set(SK_MaxS32, SK_MaxS32, SK_MinS32, SK_MinS32);
71 60
72 while ((rec = (SkLayerRasterizer_Rec*)iter.next()) != NULL) { 61 while ((rec = (SkLayerRasterizer_Rec*)iter.next()) != NULL) {
73 const SkPaint& paint = rec->fPaint; 62 const SkPaint& paint = rec->fPaint;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 SkDEBUGCODE(count++); 217 SkDEBUGCODE(count++);
229 SkLayerRasterizer_Rec* recCopy = static_cast<SkLayerRasterizer_Rec*>(lay ers->push_back()); 218 SkLayerRasterizer_Rec* recCopy = static_cast<SkLayerRasterizer_Rec*>(lay ers->push_back());
230 SkNEW_PLACEMENT_ARGS(&recCopy->fPaint, SkPaint, (recOrig->fPaint)); 219 SkNEW_PLACEMENT_ARGS(&recCopy->fPaint, SkPaint, (recOrig->fPaint));
231 recCopy->fOffset = recOrig->fOffset; 220 recCopy->fOffset = recOrig->fOffset;
232 } 221 }
233 SkASSERT(fLayers->count() == count); 222 SkASSERT(fLayers->count() == count);
234 SkASSERT(layers->count() == count); 223 SkASSERT(layers->count() == count);
235 SkLayerRasterizer* rasterizer = SkNEW_ARGS(SkLayerRasterizer, (layers)); 224 SkLayerRasterizer* rasterizer = SkNEW_ARGS(SkLayerRasterizer, (layers));
236 return rasterizer; 225 return rasterizer;
237 } 226 }
OLDNEW
« gyp/common_conditions.gypi ('K') | « src/core/SkPaintPriv.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698