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

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

Issue 1471053002: Don't create a GXPFactory when blend is SrcOver (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix compile Created 5 years, 1 month 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/GrConfigConversionEffect.cpp ('k') | src/gpu/effects/GrDisableColorXP.h » ('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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 if (this->hasHWBlendEquation()) { 314 if (this->hasHWBlendEquation()) {
315 blendInfo->fEquation = this->hwBlendEquation(); 315 blendInfo->fEquation = this->hwBlendEquation();
316 } 316 }
317 } 317 }
318 318
319 /////////////////////////////////////////////////////////////////////////////// 319 ///////////////////////////////////////////////////////////////////////////////
320 class CustomXPFactory : public GrXPFactory { 320 class CustomXPFactory : public GrXPFactory {
321 public: 321 public:
322 CustomXPFactory(SkXfermode::Mode mode); 322 CustomXPFactory(SkXfermode::Mode mode);
323 323
324 bool supportsRGBCoverage(GrColor knownColor, uint32_t knownColorFlags) const override {
325 return true;
326 }
327
328 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI, 324 void getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
329 GrXPFactory::InvariantBlendedColor*) const ove rride; 325 GrXPFactory::InvariantBlendedColor*) const ove rride;
330 326
331 private: 327 private:
332 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, 328 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps,
333 const GrProcOptInfo& colorPOI, 329 const GrProcOptInfo& colorPOI,
334 const GrProcOptInfo& coveragePOI, 330 const GrProcOptInfo& coveragePOI,
335 bool hasMixedSamples, 331 bool hasMixedSamples,
336 const DstTexture*) const override; 332 const DstTexture*) const override;
337 333
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 391
396 /////////////////////////////////////////////////////////////////////////////// 392 ///////////////////////////////////////////////////////////////////////////////
397 393
398 GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) { 394 GrXPFactory* GrCustomXfermode::CreateXPFactory(SkXfermode::Mode mode) {
399 if (!GrCustomXfermode::IsSupportedMode(mode)) { 395 if (!GrCustomXfermode::IsSupportedMode(mode)) {
400 return nullptr; 396 return nullptr;
401 } else { 397 } else {
402 return new CustomXPFactory(mode); 398 return new CustomXPFactory(mode);
403 } 399 }
404 } 400 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.cpp ('k') | src/gpu/effects/GrDisableColorXP.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698