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 | 9 |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1480 // desktop GL). | 1480 // desktop GL). |
1481 | 1481 |
1482 // We will always call some form of writeTexturePixels and we will pass our
flags on to it. | 1482 // We will always call some form of writeTexturePixels and we will pass our
flags on to it. |
1483 // Thus, we don't perform a flush here since that call will do it (if the kN
oFlush flag isn't | 1483 // Thus, we don't perform a flush here since that call will do it (if the kN
oFlush flag isn't |
1484 // set.) | 1484 // set.) |
1485 | 1485 |
1486 // If the RT is also a texture and we don't have to premultiply then take th
e texture path. | 1486 // If the RT is also a texture and we don't have to premultiply then take th
e texture path. |
1487 // We expect to be at least as fast or faster since it doesn't use an interm
ediate texture as | 1487 // We expect to be at least as fast or faster since it doesn't use an interm
ediate texture as |
1488 // we do below. | 1488 // we do below. |
1489 | 1489 |
1490 #if !GR_MAC_BUILD | 1490 #if !defined(SK_BUILD_FOR_MAC) |
1491 // At least some drivers on the Mac get confused when glTexImage2D is called
on a texture | 1491 // At least some drivers on the Mac get confused when glTexImage2D is called
on a texture |
1492 // attached to an FBO. The FBO still sees the old image. TODO: determine wha
t OS versions and/or | 1492 // attached to an FBO. The FBO still sees the old image. TODO: determine wha
t OS versions and/or |
1493 // HW is affected. | 1493 // HW is affected. |
1494 if (NULL != target->asTexture() && !(kUnpremul_PixelOpsFlag & flags) && | 1494 if (NULL != target->asTexture() && !(kUnpremul_PixelOpsFlag & flags) && |
1495 fGpu->canWriteTexturePixels(target->asTexture(), srcConfig)) { | 1495 fGpu->canWriteTexturePixels(target->asTexture(), srcConfig)) { |
1496 return this->writeTexturePixels(target->asTexture(), | 1496 return this->writeTexturePixels(target->asTexture(), |
1497 left, top, width, height, | 1497 left, top, width, height, |
1498 srcConfig, buffer, rowBytes, flags); | 1498 srcConfig, buffer, rowBytes, flags); |
1499 } | 1499 } |
1500 #endif | 1500 #endif |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 return NULL; | 1743 return NULL; |
1744 } | 1744 } |
1745 } | 1745 } |
1746 | 1746 |
1747 /////////////////////////////////////////////////////////////////////////////// | 1747 /////////////////////////////////////////////////////////////////////////////// |
1748 #if GR_CACHE_STATS | 1748 #if GR_CACHE_STATS |
1749 void GrContext::printCacheStats() const { | 1749 void GrContext::printCacheStats() const { |
1750 fTextureCache->printStats(); | 1750 fTextureCache->printStats(); |
1751 } | 1751 } |
1752 #endif | 1752 #endif |
OLD | NEW |