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

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

Issue 768183002: Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/effects/SkCornerPathEffect.cpp ('k') | src/effects/SkDiscretePathEffect.cpp » ('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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkDashPathEffect.h" 8 #include "SkDashPathEffect.h"
9 9
10 #include "SkDashPathPriv.h" 10 #include "SkDashPathPriv.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 362
363 SkFlattenable* SkDashPathEffect::CreateProc(SkReadBuffer& buffer) { 363 SkFlattenable* SkDashPathEffect::CreateProc(SkReadBuffer& buffer) {
364 const SkScalar phase = buffer.readScalar(); 364 const SkScalar phase = buffer.readScalar();
365 uint32_t count = buffer.getArrayCount(); 365 uint32_t count = buffer.getArrayCount();
366 SkAutoSTArray<32, SkScalar> intervals(count); 366 SkAutoSTArray<32, SkScalar> intervals(count);
367 if (buffer.readScalarArray(intervals.get(), count)) { 367 if (buffer.readScalarArray(intervals.get(), count)) {
368 return Create(intervals.get(), SkToInt(count), phase); 368 return Create(intervals.get(), SkToInt(count), phase);
369 } 369 }
370 return NULL; 370 return NULL;
371 } 371 }
372
373 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
374 SkDashPathEffect::SkDashPathEffect(SkReadBuffer& buffer)
375 : INHERITED(buffer)
376 , fPhase(0)
377 , fInitialDashLength(0)
378 , fInitialDashIndex(0)
379 , fIntervalLength(0) {
380 fPhase = buffer.readScalar();
381 fCount = buffer.getArrayCount();
382 size_t allocSize = sizeof(SkScalar) * fCount;
383 if (buffer.validateAvailable(allocSize)) {
384 fIntervals = (SkScalar*)sk_malloc_throw(allocSize);
385 buffer.readScalarArray(fIntervals, fCount);
386 } else {
387 fIntervals = NULL;
388 }
389
390 // set the internal data members, fPhase should have been between 0 and inte rvalLength
391 // when written to buffer so no need to adjust it
392 SkDashPath::CalcDashParameters(fPhase, fIntervals, fCount,
393 &fInitialDashLength, &fInitialDashIndex, &fIn tervalLength);
394 }
395 #endif
396
OLDNEW
« no previous file with comments | « src/effects/SkCornerPathEffect.cpp ('k') | src/effects/SkDiscretePathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698