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

Side by Side Diff: src/gpu/GrContext.cpp

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More progress & refactoring Created 4 years, 5 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/GrColorSpaceXform.cpp ('k') | src/gpu/GrPaint.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 "GrContext.h" 8 #include "GrContext.h"
9 #include "GrContextOptions.h" 9 #include "GrContextOptions.h"
10 #include "GrDrawingManager.h" 10 #include "GrDrawingManager.h"
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 } 536 }
537 537
538 SkSurfaceProps props(SkSurfaceProps::kGammaCorrect_Flag, 538 SkSurfaceProps props(SkSurfaceProps::kGammaCorrect_Flag,
539 SkSurfaceProps::kLegacyFontHost_InitType); 539 SkSurfaceProps::kLegacyFontHost_InitType);
540 sk_sp<GrDrawContext> drawContext(this->drawContext(sk_ref_sp(dst), &props)); 540 sk_sp<GrDrawContext> drawContext(this->drawContext(sk_ref_sp(dst), &props));
541 if (!drawContext) { 541 if (!drawContext) {
542 return false; 542 return false;
543 } 543 }
544 544
545 GrPaint paint; 545 GrPaint paint;
546 paint.addColorTextureProcessor(src, GrCoordTransform::MakeDivByTextureWHMatr ix(src)); 546 paint.addColorTextureProcessor(src, nullptr, GrCoordTransform::MakeDivByText ureWHMatrix(src));
547 if (!SkScalarNearlyEqual(gamma, 1.0f)) { 547 if (!SkScalarNearlyEqual(gamma, 1.0f)) {
548 paint.addColorFragmentProcessor(GrGammaEffect::Make(gamma)); 548 paint.addColorFragmentProcessor(GrGammaEffect::Make(gamma));
549 } 549 }
550 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 550 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
551 paint.setGammaCorrect(true); 551 paint.setGammaCorrect(true);
552 552
553 SkRect rect; 553 SkRect rect;
554 src->getBoundsRect(&rect); 554 src->getBoundsRect(&rect);
555 drawContext->drawRect(GrNoClip(), paint, SkMatrix::I(), rect); 555 drawContext->drawRect(GrNoClip(), paint, SkMatrix::I(), rect);
556 556
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 ASSERT_SINGLE_OWNER 758 ASSERT_SINGLE_OWNER
759 fResourceCache->setLimits(maxTextures, maxTextureBytes); 759 fResourceCache->setLimits(maxTextures, maxTextureBytes);
760 } 760 }
761 761
762 ////////////////////////////////////////////////////////////////////////////// 762 //////////////////////////////////////////////////////////////////////////////
763 763
764 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { 764 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
765 ASSERT_SINGLE_OWNER 765 ASSERT_SINGLE_OWNER
766 fResourceCache->dumpMemoryStatistics(traceMemoryDump); 766 fResourceCache->dumpMemoryStatistics(traceMemoryDump);
767 } 767 }
OLDNEW
« no previous file with comments | « src/gpu/GrColorSpaceXform.cpp ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698