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

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

Issue 1658623002: Add gpu implementation of SkAvoidXfermode (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 years, 10 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/effects/SkAvoidXfermode.cpp ('k') | src/gpu/GrProcessor.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 2011 Google Inc. 2 * Copyright 2011 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 "SkPixelXorXfermode.h" 8 #include "SkPixelXorXfermode.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 } 338 }
339 339
340 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps, 340 GrXferProcessor* onCreateXferProcessor(const GrCaps& caps,
341 const GrPipelineOptimizations& optimi zations, 341 const GrPipelineOptimizations& optimi zations,
342 bool hasMixedSamples, 342 bool hasMixedSamples,
343 const DstTexture* dstTexture) const o verride { 343 const DstTexture* dstTexture) const o verride {
344 return new PixelXorXP(dstTexture, hasMixedSamples, fOpColor); 344 return new PixelXorXP(dstTexture, hasMixedSamples, fOpColor);
345 } 345 }
346 346
347 bool onWillReadDstColor(const GrCaps& caps, 347 bool onWillReadDstColor(const GrCaps& caps,
348 const GrPipelineOptimizations& optimizations, 348 const GrPipelineOptimizations& optimizations,
349 bool hasMixedSamples) const override { 349 bool hasMixedSamples) const override {
350 return true; 350 return true;
351 } 351 }
352 352
353 bool onIsEqual(const GrXPFactory& xpfBase) const override { 353 bool onIsEqual(const GrXPFactory& xpfBase) const override {
354 const GrPixelXorXPFactory& xpf = xpfBase.cast<GrPixelXorXPFactory>(); 354 const GrPixelXorXPFactory& xpf = xpfBase.cast<GrPixelXorXPFactory>();
355 return fOpColor == xpf.fOpColor; 355 return fOpColor == xpf.fOpColor;
356 } 356 }
357 357
358 GR_DECLARE_XP_FACTORY_TEST; 358 GR_DECLARE_XP_FACTORY_TEST;
359 359
(...skipping 21 matching lines...) Expand all
381 } 381 }
382 382
383 bool SkPixelXorXfermode::asXPFactory(GrXPFactory** xpf) const { 383 bool SkPixelXorXfermode::asXPFactory(GrXPFactory** xpf) const {
384 if (xpf) { 384 if (xpf) {
385 *xpf = GrPixelXorXPFactory::Create(fOpColor); 385 *xpf = GrPixelXorXPFactory::Create(fOpColor);
386 } 386 }
387 return true; 387 return true;
388 } 388 }
389 389
390 #endif 390 #endif
OLDNEW
« no previous file with comments | « src/effects/SkAvoidXfermode.cpp ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698