Skip to content

Commit

Permalink
removed back reference to PImage from ImageCache (issue #1391)
Browse files Browse the repository at this point in the history
  • Loading branch information
codeanticode committed Apr 10, 2013
1 parent 83c97b0 commit 3b64812
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/src/processing/core/PGraphicsJava2D.java
Expand Up @@ -1258,7 +1258,7 @@ protected void imageImpl(PImage who,
}

if (who.modified) {
cash.update(tint, tintColor);
cash.update(who, tint, tintColor);
who.modified = false;
}

Expand Down Expand Up @@ -1291,14 +1291,13 @@ protected void imageImpl(PImage who,


class ImageCache {
PImage source;
boolean tinted;
int tintedColor;
int tintedPixels[]; // one row of tinted pixels
BufferedImage image;

public ImageCache(PImage source) {
this.source = source;
// this.source = source;
// even if RGB, set the image type to ARGB, because the
// image may have an alpha value for its tint().
// int type = BufferedImage.TYPE_INT_ARGB;
Expand All @@ -1311,7 +1310,7 @@ public ImageCache(PImage source) {
* has changed, or the pixels have changed, so should just go through
* with the update without further checks.
*/
public void update(boolean tint, int tintColor) {
public void update(PImage source, boolean tint, int tintColor) {
int bufferType = BufferedImage.TYPE_INT_ARGB;
boolean opaque = (tintColor & 0xFF000000) == 0xFF000000;
if (source.format == RGB) {
Expand Down

0 comments on commit 3b64812

Please sign in to comment.