OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 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 #ifndef GrContext_DEFINED | 10 #ifndef GrContext_DEFINED |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 * GrRenderTarget::asTexture()). Any pending draws to the render target will | 612 * GrRenderTarget::asTexture()). Any pending draws to the render target will |
613 * be executed before the resolve. | 613 * be executed before the resolve. |
614 * | 614 * |
615 * This is only necessary when a client wants to access the object directly | 615 * This is only necessary when a client wants to access the object directly |
616 * using the backend API directly. GrContext will detect when it must | 616 * using the backend API directly. GrContext will detect when it must |
617 * perform a resolve to a GrTexture used as the source of a draw or before | 617 * perform a resolve to a GrTexture used as the source of a draw or before |
618 * reading pixels back from a GrTexture or GrRenderTarget. | 618 * reading pixels back from a GrTexture or GrRenderTarget. |
619 */ | 619 */ |
620 void resolveRenderTarget(GrRenderTarget* target); | 620 void resolveRenderTarget(GrRenderTarget* target); |
621 | 621 |
622 /** | |
623 * Applies a 2D Gaussian blur to a given texture. | |
624 * @param srcTexture The source texture to be blurred. | |
625 * @param canClobberSrc If true, srcTexture may be overwritten, and | |
626 * may be returned as the result. | |
627 * @param rect The destination rectangle. | |
628 * @param sigmaX The blur's standard deviation in X. | |
629 * @param sigmaY The blur's standard deviation in Y. | |
630 * @return the blurred texture, which may be srcTexture reffed, or a | |
631 * new texture. It is the caller's responsibility to unref this texture. | |
632 */ | |
633 GrTexture* gaussianBlur(GrTexture* srcTexture, | |
634 bool canClobberSrc, | |
635 const SkRect& rect, | |
636 float sigmaX, float sigmaY); | |
637 | |
638 /////////////////////////////////////////////////////////////////////////// | 622 /////////////////////////////////////////////////////////////////////////// |
639 // Helpers | 623 // Helpers |
640 | 624 |
641 class AutoRenderTarget : public ::GrNoncopyable { | 625 class AutoRenderTarget : public ::GrNoncopyable { |
642 public: | 626 public: |
643 AutoRenderTarget(GrContext* context, GrRenderTarget* target) { | 627 AutoRenderTarget(GrContext* context, GrRenderTarget* target) { |
644 fPrevTarget = context->getRenderTarget(); | 628 fPrevTarget = context->getRenderTarget(); |
645 GrSafeRef(fPrevTarget); | 629 GrSafeRef(fPrevTarget); |
646 context->setRenderTarget(target); | 630 context->setRenderTarget(target); |
647 fContext = context; | 631 fContext = context; |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 } | 1002 } |
1019 | 1003 |
1020 GrTexture* texture() { return fTexture; } | 1004 GrTexture* texture() { return fTexture; } |
1021 | 1005 |
1022 private: | 1006 private: |
1023 GrContext* fContext; | 1007 GrContext* fContext; |
1024 GrTexture* fTexture; | 1008 GrTexture* fTexture; |
1025 }; | 1009 }; |
1026 | 1010 |
1027 #endif | 1011 #endif |
OLD | NEW |