OLD | NEW |
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 "effects/GrBicubicEffect.h" | 10 #include "effects/GrBicubicEffect.h" |
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 dstSize.fHeight = tmpDst.height(); | 1537 dstSize.fHeight = tmpDst.height(); |
1538 | 1538 |
1539 this->drawBitmapCommon(*draw, bitmap, &tmpSrc, &dstSize, paint, flags); | 1539 this->drawBitmapCommon(*draw, bitmap, &tmpSrc, &dstSize, paint, flags); |
1540 } | 1540 } |
1541 | 1541 |
1542 void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, | 1542 void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, |
1543 int x, int y, const SkPaint& paint) { | 1543 int x, int y, const SkPaint& paint) { |
1544 // clear of the source device must occur before CHECK_SHOULD_DRAW | 1544 // clear of the source device must occur before CHECK_SHOULD_DRAW |
1545 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawDevice", fContext); | 1545 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawDevice", fContext); |
1546 SkGpuDevice* dev = static_cast<SkGpuDevice*>(device); | 1546 SkGpuDevice* dev = static_cast<SkGpuDevice*>(device); |
1547 if (fNeedClear) { | 1547 |
1548 // TODO: could check here whether we really need to draw at all | 1548 // TODO: If the source device covers the whole of this device, we could |
1549 dev->clearAll(); | 1549 // omit fNeedsClear -related flushing. |
1550 } | 1550 // TODO: if source needs clear, we could maybe omit the draw fully. |
1551 | 1551 |
1552 // drawDevice is defined to be in device coords. | 1552 // drawDevice is defined to be in device coords. |
1553 CHECK_SHOULD_DRAW(draw); | 1553 CHECK_SHOULD_DRAW(draw); |
1554 | 1554 |
1555 GrRenderTarget* devRT = dev->accessRenderTarget(); | 1555 GrRenderTarget* devRT = dev->accessRenderTarget(); |
1556 GrTexture* devTex; | 1556 GrTexture* devTex; |
1557 if (NULL == (devTex = devRT->asTexture())) { | 1557 if (NULL == (devTex = devRT->asTexture())) { |
1558 return; | 1558 return; |
1559 } | 1559 } |
1560 | 1560 |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1905 #endif | 1905 #endif |
1906 } | 1906 } |
1907 | 1907 |
1908 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1908 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1909 // We always return a transient cache, so it is freed after each | 1909 // We always return a transient cache, so it is freed after each |
1910 // filter traversal. | 1910 // filter traversal. |
1911 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1911 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1912 } | 1912 } |
1913 | 1913 |
1914 #endif | 1914 #endif |
OLD | NEW |