| 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/GrTextureDomainEffect.h" | 10 #include "effects/GrTextureDomainEffect.h" |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 copy.setColor(SkColorSetA(color, newA)); | 506 copy.setColor(SkColorSetA(color, newA)); |
| 507 return skPaint2GrPaintNoShader(dev, copy, false, constantColor, grPa
int); | 507 return skPaint2GrPaintNoShader(dev, copy, false, constantColor, grPa
int); |
| 508 } else { | 508 } else { |
| 509 return false; | 509 return false; |
| 510 } | 510 } |
| 511 } | 511 } |
| 512 } | 512 } |
| 513 } | 513 } |
| 514 | 514 |
| 515 /////////////////////////////////////////////////////////////////////////////// | 515 /////////////////////////////////////////////////////////////////////////////// |
| 516 void SkGpuDevice::getGlobalBounds(SkIRect* bounds) const { | |
| 517 if (NULL != bounds) { | |
| 518 const SkIPoint& origin = this->getOrigin(); | |
| 519 bounds->setXYWH(origin.x(), origin.y(), | |
| 520 this->width(), this->height()); | |
| 521 } | |
| 522 } | |
| 523 | 516 |
| 524 SkBitmap::Config SkGpuDevice::config() const { | 517 SkBitmap::Config SkGpuDevice::config() const { |
| 525 if (NULL == fRenderTarget) { | 518 if (NULL == fRenderTarget) { |
| 526 return SkBitmap::kNo_Config; | 519 return SkBitmap::kNo_Config; |
| 527 } | 520 } |
| 528 | 521 |
| 529 bool isOpaque; | 522 bool isOpaque; |
| 530 return grConfig2skConfig(fRenderTarget->config(), &isOpaque); | 523 return grConfig2skConfig(fRenderTarget->config(), &isOpaque); |
| 531 } | 524 } |
| 532 | 525 |
| (...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1850 GrTexture* texture, | 1843 GrTexture* texture, |
| 1851 bool needClear) | 1844 bool needClear) |
| 1852 : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) { | 1845 : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) { |
| 1853 | 1846 |
| 1854 SkASSERT(texture && texture->asRenderTarget()); | 1847 SkASSERT(texture && texture->asRenderTarget()); |
| 1855 // This constructor is called from onCreateCompatibleDevice. It has locked t
he RT in the texture | 1848 // This constructor is called from onCreateCompatibleDevice. It has locked t
he RT in the texture |
| 1856 // cache. We pass true for the third argument so that it will get unlocked. | 1849 // cache. We pass true for the third argument so that it will get unlocked. |
| 1857 this->initFromRenderTarget(context, texture->asRenderTarget(), true); | 1850 this->initFromRenderTarget(context, texture->asRenderTarget(), true); |
| 1858 fNeedClear = needClear; | 1851 fNeedClear = needClear; |
| 1859 } | 1852 } |
| OLD | NEW |