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

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

Issue 2074103004: Revert of More removal of SkColorProfileType... (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/core/SkImageInfo.cpp ('k') | src/gpu/GrSurface.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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } else { 237 } else {
238 fDrawingManager->flush(); 238 fDrawingManager->flush();
239 } 239 }
240 fResourceCache->notifyFlushOccurred(); 240 fResourceCache->notifyFlushOccurred();
241 fFlushToReduceCacheSize = false; 241 fFlushToReduceCacheSize = false;
242 } 242 }
243 243
244 bool sw_convert_to_premul(GrPixelConfig srcConfig, int width, int height, size_t inRowBytes, 244 bool sw_convert_to_premul(GrPixelConfig srcConfig, int width, int height, size_t inRowBytes,
245 const void* inPixels, size_t outRowBytes, void* outPix els) { 245 const void* inPixels, size_t outRowBytes, void* outPix els) {
246 SkSrcPixelInfo srcPI; 246 SkSrcPixelInfo srcPI;
247 if (!GrPixelConfigToColorAndColorSpace(srcConfig, &srcPI.fColorType, nullptr )) { 247 if (!GrPixelConfig2ColorAndProfileType(srcConfig, &srcPI.fColorType, nullptr )) {
248 return false; 248 return false;
249 } 249 }
250 srcPI.fAlphaType = kUnpremul_SkAlphaType; 250 srcPI.fAlphaType = kUnpremul_SkAlphaType;
251 srcPI.fPixels = inPixels; 251 srcPI.fPixels = inPixels;
252 srcPI.fRowBytes = inRowBytes; 252 srcPI.fRowBytes = inRowBytes;
253 253
254 SkDstPixelInfo dstPI; 254 SkDstPixelInfo dstPI;
255 dstPI.fColorType = srcPI.fColorType; 255 dstPI.fColorType = srcPI.fColorType;
256 dstPI.fAlphaType = kPremul_SkAlphaType; 256 dstPI.fAlphaType = kPremul_SkAlphaType;
257 dstPI.fPixels = outPixels; 257 dstPI.fPixels = outPixels;
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 configToRead = tempDrawInfo.fReadConfig; 504 configToRead = tempDrawInfo.fReadConfig;
505 } 505 }
506 if (!fGpu->readPixels(surfaceToRead, left, top, width, height, configToRead, buffer, 506 if (!fGpu->readPixels(surfaceToRead, left, top, width, height, configToRead, buffer,
507 rowBytes)) { 507 rowBytes)) {
508 return false; 508 return false;
509 } 509 }
510 510
511 // Perform umpremul conversion if we weren't able to perform it as a draw. 511 // Perform umpremul conversion if we weren't able to perform it as a draw.
512 if (unpremul) { 512 if (unpremul) {
513 SkDstPixelInfo dstPI; 513 SkDstPixelInfo dstPI;
514 if (!GrPixelConfigToColorAndColorSpace(dstConfig, &dstPI.fColorType, nul lptr)) { 514 if (!GrPixelConfig2ColorAndProfileType(dstConfig, &dstPI.fColorType, nul lptr)) {
515 return false; 515 return false;
516 } 516 }
517 dstPI.fAlphaType = kUnpremul_SkAlphaType; 517 dstPI.fAlphaType = kUnpremul_SkAlphaType;
518 dstPI.fPixels = buffer; 518 dstPI.fPixels = buffer;
519 dstPI.fRowBytes = rowBytes; 519 dstPI.fRowBytes = rowBytes;
520 520
521 SkSrcPixelInfo srcPI; 521 SkSrcPixelInfo srcPI;
522 srcPI.fColorType = dstPI.fColorType; 522 srcPI.fColorType = dstPI.fColorType;
523 srcPI.fAlphaType = kPremul_SkAlphaType; 523 srcPI.fAlphaType = kPremul_SkAlphaType;
524 srcPI.fPixels = buffer; 524 srcPI.fPixels = buffer;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 ASSERT_SINGLE_OWNER 764 ASSERT_SINGLE_OWNER
765 fResourceCache->setLimits(maxTextures, maxTextureBytes); 765 fResourceCache->setLimits(maxTextures, maxTextureBytes);
766 } 766 }
767 767
768 ////////////////////////////////////////////////////////////////////////////// 768 //////////////////////////////////////////////////////////////////////////////
769 769
770 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { 770 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const {
771 ASSERT_SINGLE_OWNER 771 ASSERT_SINGLE_OWNER
772 fResourceCache->dumpMemoryStatistics(traceMemoryDump); 772 fResourceCache->dumpMemoryStatistics(traceMemoryDump);
773 } 773 }
OLDNEW
« no previous file with comments | « src/core/SkImageInfo.cpp ('k') | src/gpu/GrSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698