mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-13 01:13:10 +00:00
8143150: DrawImagePipe can skip some unnecessary blits
Reviewed-by: flar
This commit is contained in:
parent
0b2fc2dc98
commit
3bf8e76847
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user