/*******************************************************************************
 * Copyright 2011 See AUTHORS file.
 * 
 * Licensed 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
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/

package com.badlogic.gdx.tests;

import com.badlogic.gdx.Files;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.tests.utils.GdxTest;
import com.badlogic.gdx.utils.ScreenUtils;

public class PixmapBlendingTest extends GdxTest {
	private SpriteBatch spriteBatch;
	private Texture text;
	private Sprite logoSprite, test3, test4;
	private Pixmap pixD, pixS1, pixS2;

	InputProcessor inputProcessor;

	@Override
	public void create () {
		if (spriteBatch != null) return;
		spriteBatch = new SpriteBatch();

		Matrix4 transform = new Matrix4();
		transform.setToTranslation(0, Gdx.graphics.getHeight(), 0);
		transform.mul(new Matrix4().setToScaling(1, -1, 1));
		spriteBatch.setTransformMatrix(transform);

		pixS1 = new Pixmap(Gdx.files.getFileHandle("data/test4.png", Files.FileType.Internal));
		pixS2 = new Pixmap(Gdx.files.getFileHandle("data/test3.png", Files.FileType.Internal));
		pixD = new Pixmap(512, 1024, Pixmap.Format.RGBA8888);

		pixD.setBlending(Pixmap.Blending.SourceOver);
		pixD.setFilter(Pixmap.Filter.NearestNeighbour);

		pixD.drawPixmap(pixS1, 0, 0, 38, 76, 0, 0, 512, 1024);
		pixD.drawPixmap(pixS2, 0, 0, 38, 76, 0, 0, 512, 1024);

		logoSprite = new Sprite(new Texture(pixD));
		logoSprite.flip(false, true);

		pixS1.dispose();
		pixS2.dispose();
		pixD.dispose();
	}

	@Override
	public void render () {

		ScreenUtils.clear(0, 1, 0, 1);

		spriteBatch.begin();
		logoSprite.setSize(256, 256);
		logoSprite.draw(spriteBatch);
		spriteBatch.end();

	}

	public boolean needsGL20 () {
		return false;
	}
}

@@ -812,82 +812,11 @@
 gdx.
-Files;%0Aimport com.badlogic.gdx.Gdx;%0Aimport com.badlogic.gdx.InputProcessor
+Gdx
 ;%0Aim
@@ -1206,31 +1206,8 @@
 ch;%0A
-%09private Texture text;%0A
 %09pri
@@ -1232,22 +1232,8 @@
 rite
-, test3, test4
 ;%0A%09p
@@ -1271,41 +1271,8 @@
 2;%0A%0A
-%09InputProcessor inputProcessor;%0A%0A
 %09@Ov
@@ -1601,37 +1601,32 @@
 p(Gdx.files.
-getFileHandle
+internal
 (%22data/test4
@@ -1634,33 +1634,8 @@
 png%22
-, Files.FileType.Internal
 ));%0A
@@ -1669,21 +1669,16 @@
 les.
-getFileHandle
+internal
 (%22da
@@ -1694,33 +1694,8 @@
 png%22
-, Files.FileType.Internal
 ));%0A

Clean Up PixmapBlendingTest (#6732)