OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
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 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkColor.h" | 9 #include "SkColor.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 SkPaint* SkLayerDrawLooper::Builder::addLayerOnTop(const LayerInfo& info) { | 331 SkPaint* SkLayerDrawLooper::Builder::addLayerOnTop(const LayerInfo& info) { |
332 fCount += 1; | 332 fCount += 1; |
333 | 333 |
334 Rec* rec = SkNEW(Rec); | 334 Rec* rec = SkNEW(Rec); |
335 rec->fNext = NULL; | 335 rec->fNext = NULL; |
336 rec->fInfo = info; | 336 rec->fInfo = info; |
337 if (NULL == fRecs) { | 337 if (NULL == fRecs) { |
338 fRecs = rec; | 338 fRecs = rec; |
339 } else { | 339 } else { |
340 SkASSERT(NULL != fTopRec); | 340 SkASSERT(fTopRec); |
341 fTopRec->fNext = rec; | 341 fTopRec->fNext = rec; |
342 } | 342 } |
343 fTopRec = rec; | 343 fTopRec = rec; |
344 | 344 |
345 return &rec->fPaint; | 345 return &rec->fPaint; |
346 } | 346 } |
347 | 347 |
348 SkLayerDrawLooper* SkLayerDrawLooper::Builder::detachLooper() { | 348 SkLayerDrawLooper* SkLayerDrawLooper::Builder::detachLooper() { |
349 SkLayerDrawLooper* looper = SkNEW(SkLayerDrawLooper); | 349 SkLayerDrawLooper* looper = SkNEW(SkLayerDrawLooper); |
350 looper->fCount = fCount; | 350 looper->fCount = fCount; |
351 looper->fRecs = fRecs; | 351 looper->fRecs = fRecs; |
352 | 352 |
353 fCount = 0; | 353 fCount = 0; |
354 fRecs = NULL; | 354 fRecs = NULL; |
355 fTopRec = NULL; | 355 fTopRec = NULL; |
356 | 356 |
357 return looper; | 357 return looper; |
358 } | 358 } |
OLD | NEW |