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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 drawState->setVertexAttribs(kVertexAttribs, SK_ARRAY_COUNT(kVertexAttrib
s)); | 366 drawState->setVertexAttribs(kVertexAttribs, SK_ARRAY_COUNT(kVertexAttrib
s)); |
367 | 367 |
368 GrDrawTarget::AutoReleaseGeometry arg(fGpu, 4, 0); | 368 GrDrawTarget::AutoReleaseGeometry arg(fGpu, 4, 0); |
369 | 369 |
370 if (arg.succeeded()) { | 370 if (arg.succeeded()) { |
371 GrPoint* verts = (GrPoint*) arg.vertices(); | 371 GrPoint* verts = (GrPoint*) arg.vertices(); |
372 verts[0].setIRectFan(0, 0, texture->width(), texture->height(), 2 *
sizeof(GrPoint)); | 372 verts[0].setIRectFan(0, 0, texture->width(), texture->height(), 2 *
sizeof(GrPoint)); |
373 verts[1].setIRectFan(0, 0, 1, 1, 2 * sizeof(GrPoint)); | 373 verts[1].setIRectFan(0, 0, 1, 1, 2 * sizeof(GrPoint)); |
374 fGpu->drawNonIndexed(kTriangleFan_GrPrimitiveType, 0, 4); | 374 fGpu->drawNonIndexed(kTriangleFan_GrPrimitiveType, 0, 4); |
375 } | 375 } |
376 texture->releaseRenderTarget(); | |
377 } else { | 376 } else { |
378 // TODO: Our CPU stretch doesn't filter. But we create separate | 377 // TODO: Our CPU stretch doesn't filter. But we create separate |
379 // stretched textures when the texture params is either filtered or | 378 // stretched textures when the texture params is either filtered or |
380 // not. Either implement filtered stretch blit on CPU or just create | 379 // not. Either implement filtered stretch blit on CPU or just create |
381 // one when FBO case fails. | 380 // one when FBO case fails. |
382 | 381 |
383 rtDesc.fFlags = kNone_GrTextureFlags; | 382 rtDesc.fFlags = kNone_GrTextureFlags; |
384 // no longer need to clamp at min RT size. | 383 // no longer need to clamp at min RT size. |
385 rtDesc.fWidth = GrNextPow2(desc.fWidth); | 384 rtDesc.fWidth = GrNextPow2(desc.fWidth); |
386 rtDesc.fHeight = GrNextPow2(desc.fHeight); | 385 rtDesc.fHeight = GrNextPow2(desc.fHeight); |
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 return srcTexture; | 1798 return srcTexture; |
1800 } | 1799 } |
1801 } | 1800 } |
1802 | 1801 |
1803 /////////////////////////////////////////////////////////////////////////////// | 1802 /////////////////////////////////////////////////////////////////////////////// |
1804 #if GR_CACHE_STATS | 1803 #if GR_CACHE_STATS |
1805 void GrContext::printCacheStats() const { | 1804 void GrContext::printCacheStats() const { |
1806 fTextureCache->printStats(); | 1805 fTextureCache->printStats(); |
1807 } | 1806 } |
1808 #endif | 1807 #endif |
OLD | NEW |