From patchwork Tue Sep 10 23:46:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 21226 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4B6F4BF415 for ; Tue, 10 Sep 2024 23:47:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 002C6634FD; Wed, 11 Sep 2024 01:47:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="nVy5jsmA"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9917F634FC for ; Wed, 11 Sep 2024 01:47:25 +0200 (CEST) Received: from pendragon.ideasonboard.com (213-229-8-243.static.upcbusiness.at [213.229.8.243]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3BA92108D; Wed, 11 Sep 2024 01:46:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1726011968; bh=tBB/fm/QHR7uGKEdy9aFeQXVkHB9SG45Rlj9Mz3TBII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nVy5jsmA/iT8Jv9kag9i3HuuusPhCulpgqrYx/V8DlASw4QN5DFrKHPno4osvFE7I tnbkFSQZI4pY7pJRTRXXHPvJsCdPv/GfnWAuW/0eHUgtZpo5qwEsvZXxELTErbVwXz CJlZROsqlm8w8YvUO8COIeCFa0iXle4Jqyxev5Z4= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Neal Gompa Subject: [PATCH 2/3] qcam: viewfinder_gl: Drop duplicate glClearColor() Date: Wed, 11 Sep 2024 02:46:48 +0300 Message-ID: <20240910234649.28591-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240910234649.28591-1-laurent.pinchart@ideasonboard.com> References: <20240910234649.28591-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" There's no need to call glClearColor() twice before drawing any GL content. Drop the first call. This doesn't introduce any functional change. While at it, pass floats instead of doubles to glClearColor(), as required by the function. Signed-off-by: Laurent Pinchart --- src/apps/qcam/viewfinder_gl.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/apps/qcam/viewfinder_gl.cpp b/src/apps/qcam/viewfinder_gl.cpp index 5be7bec539bf..b2096faf859f 100644 --- a/src/apps/qcam/viewfinder_gl.cpp +++ b/src/apps/qcam/viewfinder_gl.cpp @@ -533,8 +533,6 @@ void ViewFinderGL::initializeGL() /* Create Vertex Shader */ if (!createVertexShader()) qWarning() << "[ViewFinderGL]: create vertex shader failed."; - - glClearColor(1.0f, 1.0f, 1.0f, 0.0f); } void ViewFinderGL::doRender() @@ -821,7 +819,7 @@ void ViewFinderGL::paintGL() } if (image_) { - glClearColor(0.0, 0.0, 0.0, 1.0); + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); doRender();