Chromium Code Reviews| 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 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 565 return 0; | 565 return 0; |
| 566 } | 566 } |
| 567 int chosenSampleCount = 0; | 567 int chosenSampleCount = 0; |
| 568 if (fGpu->caps()->shaderCaps()->pathRenderingSupport()) { | 568 if (fGpu->caps()->shaderCaps()->pathRenderingSupport()) { |
| 569 if (dpi >= 250.0f) { | 569 if (dpi >= 250.0f) { |
| 570 chosenSampleCount = 4; | 570 chosenSampleCount = 4; |
| 571 } else { | 571 } else { |
| 572 chosenSampleCount = 16; | 572 chosenSampleCount = 16; |
| 573 } | 573 } |
| 574 } | 574 } |
| 575 return chosenSampleCount <= fGpu->caps()->maxSampleCount() ? | 575 bool validSampleCount = chosenSampleCount <= fGpu->caps()->maxColorSampleCou nt() && |
|
bsalomon
2016/01/15 18:08:29
Might need a check for mixed samples support here.
| |
| 576 chosenSampleCount : 0; | 576 chosenSampleCount <= fGpu->caps()->maxStencilSampleC ount(); |
| 577 return validSampleCount ? chosenSampleCount : 0; | |
| 577 } | 578 } |
| 578 | 579 |
| 579 | 580 |
| 580 GrDrawContext* GrContext::drawContext(GrRenderTarget* rt, const SkSurfaceProps* surfaceProps) { | 581 GrDrawContext* GrContext::drawContext(GrRenderTarget* rt, const SkSurfaceProps* surfaceProps) { |
| 581 ASSERT_SINGLE_OWNER | 582 ASSERT_SINGLE_OWNER |
| 582 return fDrawingManager->drawContext(rt, surfaceProps); | 583 return fDrawingManager->drawContext(rt, surfaceProps); |
| 583 } | 584 } |
| 584 | 585 |
| 585 bool GrContext::abandoned() const { | 586 bool GrContext::abandoned() const { |
| 586 ASSERT_SINGLE_OWNER | 587 ASSERT_SINGLE_OWNER |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 662 ASSERT_SINGLE_OWNER | 663 ASSERT_SINGLE_OWNER |
| 663 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 664 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
| 664 } | 665 } |
| 665 | 666 |
| 666 ////////////////////////////////////////////////////////////////////////////// | 667 ////////////////////////////////////////////////////////////////////////////// |
| 667 | 668 |
| 668 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { | 669 void GrContext::dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const { |
| 669 ASSERT_SINGLE_OWNER | 670 ASSERT_SINGLE_OWNER |
| 670 fResourceCache->dumpMemoryStatistics(traceMemoryDump); | 671 fResourceCache->dumpMemoryStatistics(traceMemoryDump); |
| 671 } | 672 } |
| OLD | NEW |