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

Side by Side Diff: src/gpu/effects/GrCustomXfermode.cpp

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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
« no previous file with comments | « src/gpu/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrDashingEffect.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 2015 Google Inc. 2 * Copyright 2015 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 "effects/GrCustomXfermode.h" 8 #include "effects/GrCustomXfermode.h"
9 9
10 #include "GrCoordTransform.h" 10 #include "GrCoordTransform.h"
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 return !can_use_hw_blend_equation(fHWBlendEquation, optimizations, caps); 375 return !can_use_hw_blend_equation(fHWBlendEquation, optimizations, caps);
376 } 376 }
377 377
378 void CustomXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI, 378 void CustomXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
379 InvariantBlendedColor* blendedCol or) const { 379 InvariantBlendedColor* blendedCol or) const {
380 blendedColor->fWillBlendWithDst = true; 380 blendedColor->fWillBlendWithDst = true;
381 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags; 381 blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags;
382 } 382 }
383 383
384 GR_DEFINE_XP_FACTORY_TEST(CustomXPFactory); 384 GR_DEFINE_XP_FACTORY_TEST(CustomXPFactory);
385 const GrXPFactory* CustomXPFactory::TestCreate(GrProcessorTestData* d) { 385 sk_sp<GrXPFactory> CustomXPFactory::TestCreate(GrProcessorTestData* d) {
386 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1, 386 int mode = d->fRandom->nextRangeU(SkXfermode::kLastCoeffMode + 1,
387 SkXfermode::kLastSeparableMode); 387 SkXfermode::kLastSeparableMode);
388 388
389 return new CustomXPFactory(static_cast<SkXfermode::Mode>(mode)); 389 return sk_sp<GrXPFactory>(new CustomXPFactory(static_cast<SkXfermode::Mode>( mode)));
390 } 390 }
391 391
392 /////////////////////////////////////////////////////////////////////////////// 392 ///////////////////////////////////////////////////////////////////////////////
393 393
394 GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) { 394 sk_sp<GrXPFactory> GrCustomXfermode::MakeXPFactory(SkXfermode::Mode mode) {
395 if (!GrCustomXfermode::IsSupportedMode(mode)) { 395 if (!GrCustomXfermode::IsSupportedMode(mode)) {
396 return nullptr; 396 return nullptr;
397 } else { 397 } else {
398 return new CustomXPFactory(mode); 398 return sk_sp<GrXPFactory>(new CustomXPFactory(mode));
399 } 399 }
400 } 400 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698