From 6d361d86f72d33fac41847b80883c524580f4cf3 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Wed, 31 Aug 2016 15:52:58 +0900 Subject: opengl: remove unsused "bitmap ops" in GL backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I188570d11349a5344753f3948daedf0e17806c6c Reviewed-on: https://gerrit.libreoffice.org/28536 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- vcl/inc/opengl/bmpop.hxx | 35 ----------------------------------- vcl/inc/opengl/salbmp.hxx | 5 +---- vcl/opengl/salbmp.cxx | 31 +------------------------------ 3 files changed, 2 insertions(+), 69 deletions(-) delete mode 100644 vcl/inc/opengl/bmpop.hxx diff --git a/vcl/inc/opengl/bmpop.hxx b/vcl/inc/opengl/bmpop.hxx deleted file mode 100644 index d19410b2f253..000000000000 --- a/vcl/inc/opengl/bmpop.hxx +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_INC_OPENGL_BMPOP_H -#define INCLUDED_VCL_INC_OPENGL_BMPOP_H - -class OpenGLSalBitmapOp -{ -public: - OpenGLSalBitmapOp() {}; - virtual ~OpenGLSalBitmapOp() {}; - - virtual bool Execute() = 0; - virtual void GetSize( Size& rSize ) const = 0; -}; - -#endif // INCLUDED_VCL_INC_OPENGL_BMPOP_H - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx index 771c4aa88413..59e1859240dc 100644 --- a/vcl/inc/opengl/salbmp.hxx +++ b/vcl/inc/opengl/salbmp.hxx @@ -23,7 +23,6 @@ #include #include -#include "opengl/bmpop.hxx" #include "opengl/texture.hxx" #include @@ -45,7 +44,6 @@ private: sal_uInt16 mnBytesPerRow; int mnWidth; int mnHeight; - std::deque< OpenGLSalBitmapOp* > maPendingOps; virtual void updateChecksum() const override; @@ -71,7 +69,7 @@ public: Size GetSize() const override; sal_uInt16 GetBitCount() const override; - BitmapBuffer *AcquireBuffer( BitmapAccessMode nMode ) override; + BitmapBuffer* AcquireBuffer( BitmapAccessMode nMode ) override; void ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode ) override; bool GetSystemData( BitmapSystemData& rData ) override; @@ -89,7 +87,6 @@ public: private: - void ExecuteOperations(); GLuint CreateTexture(); bool AllocateUserData(); bool ReadTexture(); diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index bb9bc7e8c8fd..af934019e892 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -230,8 +230,6 @@ OpenGLTexture& OpenGLSalBitmap::GetTexture() const OpenGLSalBitmap* pThis = const_cast(this); if( !maTexture || mbDirtyTexture ) pThis->CreateTexture(); - else if( !maPendingOps.empty() ) - pThis->ExecuteOperations(); VCL_GL_INFO( "Got texture " << maTexture.Id() ); return pThis->maTexture; } @@ -241,7 +239,6 @@ void OpenGLSalBitmap::Destroy() OpenGLZone aZone; VCL_GL_INFO("Destroy OpenGLSalBitmap texture:" << maTexture.Id()); - maPendingOps.clear(); maTexture = OpenGLTexture(); mpUserBuffer.reset(); } @@ -461,25 +458,7 @@ public: Size OpenGLSalBitmap::GetSize() const { - OpenGLZone aZone; - - std::deque< OpenGLSalBitmapOp* >::const_iterator it = maPendingOps.begin(); - Size aSize( mnWidth, mnHeight ); - - while( it != maPendingOps.end() ) - (*it++)->GetSize( aSize ); - - return aSize; -} - -void OpenGLSalBitmap::ExecuteOperations() -{ - while( !maPendingOps.empty() ) - { - OpenGLSalBitmapOp* pOp = maPendingOps.front(); - pOp->Execute(); - maPendingOps.pop_front(); - } + return Size(mnWidth, mnHeight); } GLuint OpenGLSalBitmap::CreateTexture() @@ -561,7 +540,6 @@ GLuint OpenGLSalBitmap::CreateTexture() if( bAllocated ) delete[] pData; - ExecuteOperations(); mbDirtyTexture = false; CHECK_GL_ERROR(); @@ -777,13 +755,6 @@ BitmapBuffer* OpenGLSalBitmap::AcquireBuffer( BitmapAccessMode nMode ) if( maTexture && !ReadTexture() ) return nullptr; } - - if( !maPendingOps.empty() ) - { - VCL_GL_INFO( "** Creating texture and reading it back immediately" ); - if( !CreateTexture() || !AllocateUserData() || !ReadTexture() ) - return nullptr; - } } // mpUserBuffer must be unique when we are doing the write access -- cgit