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

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

Issue 2188463002: Remove SkSurfaceProps gamma-correctness flag entirely. (Closed) Base URL: https://skia.googlesource.com/skia.git@remove-is-gamma-correct
Patch Set: Created 4 years, 4 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 | « include/core/SkSurfaceProps.h ('k') | src/views/SkWindow.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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 RETURN_FALSE_IF_ABANDONED 532 RETURN_FALSE_IF_ABANDONED
533 ASSERT_OWNED_RESOURCE(dst); 533 ASSERT_OWNED_RESOURCE(dst);
534 ASSERT_OWNED_RESOURCE(src); 534 ASSERT_OWNED_RESOURCE(src);
535 GR_AUDIT_TRAIL_AUTO_FRAME(&fAuditTrail, "GrContext::applyGamma"); 535 GR_AUDIT_TRAIL_AUTO_FRAME(&fAuditTrail, "GrContext::applyGamma");
536 536
537 // Dimensions must match exactly. 537 // Dimensions must match exactly.
538 if (dst->width() != src->width() || dst->height() != src->height()) { 538 if (dst->width() != src->width() || dst->height() != src->height()) {
539 return false; 539 return false;
540 } 540 }
541 541
542 SkSurfaceProps props(SkSurfaceProps::kGammaCorrect_Flag,
543 SkSurfaceProps::kLegacyFontHost_InitType);
544 // TODO: Supply color space? 542 // TODO: Supply color space?
545 sk_sp<GrDrawContext> drawContext(this->drawContext(sk_ref_sp(dst), nullptr, &props)); 543 sk_sp<GrDrawContext> drawContext(this->drawContext(sk_ref_sp(dst), nullptr)) ;
546 if (!drawContext) { 544 if (!drawContext) {
547 return false; 545 return false;
548 } 546 }
549 547
550 GrPaint paint; 548 GrPaint paint;
551 paint.addColorTextureProcessor(src, nullptr, GrCoordTransform::MakeDivByText ureWHMatrix(src)); 549 paint.addColorTextureProcessor(src, nullptr, GrCoordTransform::MakeDivByText ureWHMatrix(src));
552 if (!SkScalarNearlyEqual(gamma, 1.0f)) { 550 if (!SkScalarNearlyEqual(gamma, 1.0f)) {
553 paint.addColorFragmentProcessor(GrGammaEffect::Make(gamma)); 551 paint.addColorFragmentProcessor(GrGammaEffect::Make(gamma));
554 } 552 }
555 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 553 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 ASSERT_SINGLE_OWNER 763 ASSERT_SINGLE_OWNER
766 fResourceCache->setLimits(maxTextures, maxTextureBytes); 764 fResourceCache->setLimits(maxTextures, maxTextureBytes);
767 } 765 }
768 766
769 ////////////////////////////////////////////////////////////////////////////// 767 //////////////////////////////////////////////////////////////////////////////
770 768
771 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { 769 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
772 ASSERT_SINGLE_OWNER 770 ASSERT_SINGLE_OWNER
773 fResourceCache->dumpMemoryStatistics(traceMemoryDump); 771 fResourceCache->dumpMemoryStatistics(traceMemoryDump);
774 } 772 }
OLDNEW
« no previous file with comments | « include/core/SkSurfaceProps.h ('k') | src/views/SkWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698