// setup a solid color layer yet
ALOGV("[%s] Requesting Client composition", mName.string());
setCompositionType(hwcId, HWC2::Composition::Client);
- error = hwcLayer->setBuffer(nullptr, Fence::NO_FENCE);
- if (error != HWC2::Error::None) {
- ALOGE("[%s] Failed to set null buffer: %s (%d)", mName.string(),
- to_string(error).c_str(), static_cast<int32_t>(error));
- }
return;
}
clearWithOpenGL(hw, clip, 0,0,0,0);
}
+void Layer::handleOpenGLDraw(const sp<const DisplayDevice>& /* hw */,
+ Mesh& mesh) const {
+ const State& s(getDrawingState());
+ RenderEngine& engine(mFlinger->getRenderEngine());
+
+ engine.setupLayerBlending(mPremultipliedAlpha, isOpaque(s), s.alpha);
+ engine.drawMesh(mesh);
+ engine.disableBlending();
+}
+
void Layer::drawWithOpenGL(const sp<const DisplayDevice>& hw,
const Region& /* clip */, bool useIdentityTransform) const {
const State& s(getDrawingState());
texCoords[2] = vec2(right, 1.0f - bottom);
texCoords[3] = vec2(right, 1.0f - top);
- RenderEngine& engine(mFlinger->getRenderEngine());
- engine.setupLayerBlending(mPremultipliedAlpha, isOpaque(s), s.alpha);
- engine.drawMesh(mMesh);
- engine.disableBlending();
+ handleOpenGLDraw(hw, mMesh);
}
#ifdef USE_HWC2