| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkTwoPointConicalGradient.h" | 8 #include "SkTwoPointConicalGradient.h" |
| 9 #include "SkTwoPointConicalGradient_gpu.h" | 9 #include "SkTwoPointConicalGradient_gpu.h" |
| 10 | 10 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 info->fRadius[0] = fRadius1; | 336 info->fRadius[0] = fRadius1; |
| 337 info->fRadius[1] = fRadius2; | 337 info->fRadius[1] = fRadius2; |
| 338 if (fFlippedGrad) { | 338 if (fFlippedGrad) { |
| 339 SkTSwap(info->fPoint[0], info->fPoint[1]); | 339 SkTSwap(info->fPoint[0], info->fPoint[1]); |
| 340 SkTSwap(info->fRadius[0], info->fRadius[1]); | 340 SkTSwap(info->fRadius[0], info->fRadius[1]); |
| 341 } | 341 } |
| 342 } | 342 } |
| 343 return kConical_GradientType; | 343 return kConical_GradientType; |
| 344 } | 344 } |
| 345 | 345 |
| 346 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING | |
| 347 SkTwoPointConicalGradient::SkTwoPointConicalGradient( | |
| 348 SkReadBuffer& buffer) | |
| 349 : INHERITED(buffer) | |
| 350 , fCenter1(buffer.readPoint()) | |
| 351 , fCenter2(buffer.readPoint()) | |
| 352 , fRadius1(buffer.readScalar()) | |
| 353 , fRadius2(buffer.readScalar()) | |
| 354 , fFlippedGrad(buffer.readBool()) { | |
| 355 this->init(); | |
| 356 } | |
| 357 #endif | |
| 358 | |
| 359 SkFlattenable* SkTwoPointConicalGradient::CreateProc(SkReadBuffer& buffer) { | 346 SkFlattenable* SkTwoPointConicalGradient::CreateProc(SkReadBuffer& buffer) { |
| 360 DescriptorScope desc; | 347 DescriptorScope desc; |
| 361 if (!desc.unflatten(buffer)) { | 348 if (!desc.unflatten(buffer)) { |
| 362 return NULL; | 349 return NULL; |
| 363 } | 350 } |
| 364 SkPoint c1 = buffer.readPoint(); | 351 SkPoint c1 = buffer.readPoint(); |
| 365 SkPoint c2 = buffer.readPoint(); | 352 SkPoint c2 = buffer.readPoint(); |
| 366 SkScalar r1 = buffer.readScalar(); | 353 SkScalar r1 = buffer.readScalar(); |
| 367 SkScalar r2 = buffer.readScalar(); | 354 SkScalar r2 = buffer.readScalar(); |
| 368 | 355 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 str->appendScalar(fCenter2.fY); | 435 str->appendScalar(fCenter2.fY); |
| 449 str->append(") radius2: "); | 436 str->append(") radius2: "); |
| 450 str->appendScalar(fRadius2); | 437 str->appendScalar(fRadius2); |
| 451 str->append(" "); | 438 str->append(" "); |
| 452 | 439 |
| 453 this->INHERITED::toString(str); | 440 this->INHERITED::toString(str); |
| 454 | 441 |
| 455 str->append(")"); | 442 str->append(")"); |
| 456 } | 443 } |
| 457 #endif | 444 #endif |
| OLD | NEW |