OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrContext.h" | 9 #include "GrContext.h" |
10 | 10 |
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 void GrContext::flush(int flagsBitfield) { | 1467 void GrContext::flush(int flagsBitfield) { |
1468 if (NULL == fDrawBuffer) { | 1468 if (NULL == fDrawBuffer) { |
1469 return; | 1469 return; |
1470 } | 1470 } |
1471 | 1471 |
1472 if (kDiscard_FlushBit & flagsBitfield) { | 1472 if (kDiscard_FlushBit & flagsBitfield) { |
1473 fDrawBuffer->reset(); | 1473 fDrawBuffer->reset(); |
1474 } else { | 1474 } else { |
1475 fDrawBuffer->flush(); | 1475 fDrawBuffer->flush(); |
1476 } | 1476 } |
| 1477 fResourceCache->notifyFlushOccurred(); |
1477 fFlushToReduceCacheSize = false; | 1478 fFlushToReduceCacheSize = false; |
1478 } | 1479 } |
1479 | 1480 |
1480 bool sw_convert_to_premul(GrPixelConfig srcConfig, int width, int height, size_t
inRowBytes, | 1481 bool sw_convert_to_premul(GrPixelConfig srcConfig, int width, int height, size_t
inRowBytes, |
1481 const void* inPixels, size_t outRowBytes, void* outPix
els) { | 1482 const void* inPixels, size_t outRowBytes, void* outPix
els) { |
1482 SkSrcPixelInfo srcPI; | 1483 SkSrcPixelInfo srcPI; |
1483 if (!GrPixelConfig2ColorAndProfileType(srcConfig, &srcPI.fColorType, NULL))
{ | 1484 if (!GrPixelConfig2ColorAndProfileType(srcConfig, &srcPI.fColorType, NULL))
{ |
1484 return false; | 1485 return false; |
1485 } | 1486 } |
1486 srcPI.fAlphaType = kUnpremul_SkAlphaType; | 1487 srcPI.fAlphaType = kUnpremul_SkAlphaType; |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2013 } | 2014 } |
2014 } | 2015 } |
2015 | 2016 |
2016 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { | 2017 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { |
2017 fGpu->removeGpuTraceMarker(marker); | 2018 fGpu->removeGpuTraceMarker(marker); |
2018 if (fDrawBuffer) { | 2019 if (fDrawBuffer) { |
2019 fDrawBuffer->removeGpuTraceMarker(marker); | 2020 fDrawBuffer->removeGpuTraceMarker(marker); |
2020 } | 2021 } |
2021 } | 2022 } |
2022 | 2023 |
OLD | NEW |