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

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

Issue 1159973002: Break GrTextContext's reliance on SkGpuDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up Created 5 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/gpu/SkGpuDevice.h ('k') | no next file » | 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "GrBlurUtils.h" 10 #include "GrBlurUtils.h"
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 draw.fClip->getBounds()); 1652 draw.fClip->getBounds());
1653 } 1653 }
1654 1654
1655 void SkGpuDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkSca lar x, SkScalar y, 1655 void SkGpuDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkSca lar x, SkScalar y,
1656 const SkPaint& paint, SkDrawFilter* drawFilter) { 1656 const SkPaint& paint, SkDrawFilter* drawFilter) {
1657 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawTextBlob", fContext); 1657 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawTextBlob", fContext);
1658 CHECK_SHOULD_DRAW(draw); 1658 CHECK_SHOULD_DRAW(draw);
1659 1659
1660 SkDEBUGCODE(this->validate();) 1660 SkDEBUGCODE(this->validate();)
1661 1661
1662 fTextContext->drawTextBlob(this, fRenderTarget, fClip, paint, *draw.fMatrix, 1662 fTextContext->drawTextBlob(fRenderTarget, fClip, paint, *draw.fMatrix,
1663 blob, x, y, drawFilter, draw.fClip->getBounds()); 1663 blob, x, y, drawFilter, draw.fClip->getBounds());
1664 } 1664 }
1665 1665
1666 /////////////////////////////////////////////////////////////////////////////// 1666 ///////////////////////////////////////////////////////////////////////////////
1667 1667
1668 bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const { 1668 bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const {
1669 if (paint.getShader() || 1669 return GrTextContext::ShouldDisableLCD(paint);
1670 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode) ||
1671 paint.getMaskFilter() ||
1672 paint.getRasterizer() ||
1673 paint.getColorFilter() ||
1674 paint.getPathEffect() ||
1675 paint.isFakeBoldText() ||
1676 paint.getStyle() != SkPaint::kFill_Style)
1677 {
1678 return true;
1679 }
1680 return false;
1681 } 1670 }
1682 1671
1683 void SkGpuDevice::flush() { 1672 void SkGpuDevice::flush() {
1684 DO_DEFERRED_CLEAR(); 1673 DO_DEFERRED_CLEAR();
1685 fRenderTarget->prepareForExternalRead(); 1674 fRenderTarget->prepareForExternalRead();
1686 } 1675 }
1687 1676
1688 /////////////////////////////////////////////////////////////////////////////// 1677 ///////////////////////////////////////////////////////////////////////////////
1689 1678
1690 SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint *) { 1679 SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint *) {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 #endif 1781 #endif
1793 } 1782 }
1794 1783
1795 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 1784 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
1796 // We always return a transient cache, so it is freed after each 1785 // We always return a transient cache, so it is freed after each
1797 // filter traversal. 1786 // filter traversal.
1798 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 1787 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
1799 } 1788 }
1800 1789
1801 #endif 1790 #endif
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698