8143150: DrawImagePipe can skip some unnecessary blits

Reviewed-by: flar
This commit is contained in:
Sergey Bylokhov 2015-12-29 16:41:34 +03:00
parent 0b2fc2dc98
commit 3bf8e76847

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -955,6 +955,12 @@ public class DrawImage implements DrawImagePipe
{
comp = CompositeType.SrcNoEa;
}
if (srcData == dstData && sx == dx && sy == dy
&& CompositeType.SrcNoEa.equals(comp)) {
// Performance optimization. We skip the Blit/BlitBG if we know that
// it will be noop.
return;
}
if (!isBgOperation(srcData, bgColor)) {
Blit blit = Blit.getFromCache(srcType, comp, dstType);
blit.Blit(srcData, dstData, sg.composite, clipRegion,