Support HWUI rename of DisplayListRenderer

R=djsollen@google.com,ccraik@google.com

Review URL: https://codereview.chromium.org/1086083004
This commit is contained in:
tomhudson 2015-04-21 10:09:07 -07:00 committed by Commit bot
parent 010db5346e
commit d7c677104a
2 changed files with 10 additions and 10 deletions

View File

@ -56,20 +56,20 @@ void SkHwuiRenderer::initialize(SkISize size) {
android::uirenderer::Vector3 lightVector { lightX, -200.0f, 800.0f };
this->proxy->setup(size.width(), size.height(), lightVector, 800.0f,
255 * 0.075f, 255 * 0.15f);
this->renderer.reset(new android::uirenderer::DisplayListRenderer());
this->renderer->setViewport(size.width(), size.height());
this->canvas.reset(new android::uirenderer::DisplayListCanvas());
this->canvas->setViewport(size.width(), size.height());
}
SkCanvas* SkHwuiRenderer::prepareToDraw() {
this->renderer->prepare();
this->renderer->clipRect(0, 0, this->size.width(), this->size.height(),
SkRegion::Op::kReplace_Op);
return this->renderer->asSkCanvas();
this->canvas->prepare();
this->canvas->clipRect(0, 0, this->size.width(), this->size.height(),
SkRegion::Op::kReplace_Op);
return this->canvas->asSkCanvas();
}
void SkHwuiRenderer::finishDrawing() {
this->renderer->finish();
this->rootNode->setStagingDisplayList(this->renderer->finishRecording());
this->canvas->finish();
this->rootNode->setStagingDisplayList(this->canvas->finishRecording());
this->proxy->syncAndDrawFrame();
// Surprisingly, calling this->proxy->fence() here appears to make no difference to
// the timings we record.

View File

@ -8,7 +8,7 @@
#ifndef SkHwuiRenderer_DEFINED
#define SkHwuiRenderer_DEFINED
#include "DisplayListRenderer.h"
#include "DisplayListCanvas.h"
#include "RenderNode.h"
#include "SkTypes.h"
#include "gui/CpuConsumer.h"
@ -22,7 +22,7 @@ class SkBitmap;
struct SkHwuiRenderer {
SkAutoTDelete<android::uirenderer::RenderNode> rootNode;
SkAutoTDelete<android::uirenderer::renderthread::RenderProxy> proxy;
SkAutoTDelete<android::uirenderer::DisplayListRenderer> renderer;
SkAutoTDelete<android::uirenderer::DisplayListCanvas> canvas;
android::sp<android::IGraphicBufferProducer> producer;
android::sp<android::IGraphicBufferConsumer> consumer;
android::sp<android::CpuConsumer> cpuConsumer;