| 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 |
| 346 SkFlattenable* SkTwoPointConicalGradient::CreateProc(SkReadBuffer& buffer) { | 359 SkFlattenable* SkTwoPointConicalGradient::CreateProc(SkReadBuffer& buffer) { |
| 347 DescriptorScope desc; | 360 DescriptorScope desc; |
| 348 if (!desc.unflatten(buffer)) { | 361 if (!desc.unflatten(buffer)) { |
| 349 return NULL; | 362 return NULL; |
| 350 } | 363 } |
| 351 SkPoint c1 = buffer.readPoint(); | 364 SkPoint c1 = buffer.readPoint(); |
| 352 SkPoint c2 = buffer.readPoint(); | 365 SkPoint c2 = buffer.readPoint(); |
| 353 SkScalar r1 = buffer.readScalar(); | 366 SkScalar r1 = buffer.readScalar(); |
| 354 SkScalar r2 = buffer.readScalar(); | 367 SkScalar r2 = buffer.readScalar(); |
| 355 | 368 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 str->appendScalar(fCenter2.fY); | 448 str->appendScalar(fCenter2.fY); |
| 436 str->append(") radius2: "); | 449 str->append(") radius2: "); |
| 437 str->appendScalar(fRadius2); | 450 str->appendScalar(fRadius2); |
| 438 str->append(" "); | 451 str->append(" "); |
| 439 | 452 |
| 440 this->INHERITED::toString(str); | 453 this->INHERITED::toString(str); |
| 441 | 454 |
| 442 str->append(")"); | 455 str->append(")"); |
| 443 } | 456 } |
| 444 #endif | 457 #endif |
| OLD | NEW |