aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrGpu.cpp')
-rw-r--r--src/gpu/GrGpu.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 132d2ed4db..7807324e0f 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -233,12 +233,25 @@ GrPath* GrGpu::createPath(const SkPath& path) {
return this->onCreatePath(path);
}
-void GrGpu::clear(const GrIRect* rect, GrColor color) {
+void GrGpu::clear(const GrIRect* rect,
+ GrColor color,
+ GrRenderTarget* renderTarget) {
+ GrRenderTarget* oldRT = NULL;
+ if (NULL != renderTarget &&
+ renderTarget != this->drawState()->getRenderTarget()) {
+ oldRT = this->drawState()->getRenderTarget();
+ this->drawState()->setRenderTarget(renderTarget);
+ }
+
if (NULL == this->getDrawState().getRenderTarget()) {
return;
}
this->handleDirtyContext();
this->onClear(rect, color);
+
+ if (NULL != oldRT) {
+ this->drawState()->setRenderTarget(oldRT);
+ }
}
void GrGpu::forceRenderTargetFlush() {