Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Side by Side Diff: Source/platform/graphics/GeneratedImage.cpp

Issue 1213723006: Drop pattern-related state from GraphicsContext(State) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 RefPtr<const SkPicture> tilePicture = builder.endRecording(); 58 RefPtr<const SkPicture> tilePicture = builder.endRecording();
59 59
60 AffineTransform patternTransform; 60 AffineTransform patternTransform;
61 patternTransform.translate(phase.x(), phase.y()); 61 patternTransform.translate(phase.x(), phase.y());
62 patternTransform.scale(scale.width(), scale.height()); 62 patternTransform.scale(scale.width(), scale.height());
63 patternTransform.translate(tileRect.x(), tileRect.y()); 63 patternTransform.translate(tileRect.x(), tileRect.y());
64 64
65 RefPtr<Pattern> picturePattern = Pattern::createPicturePattern(tilePicture); 65 RefPtr<Pattern> picturePattern = Pattern::createPicturePattern(tilePicture);
66 picturePattern->setPatternSpaceTransform(patternTransform); 66 picturePattern->setPatternSpaceTransform(patternTransform);
67 67
68 GraphicsContextStateSaver saver(*destContext); 68 SkPaint fillPaint = destContext->fillPaint();
69 destContext->setFillPattern(picturePattern); 69 fillPaint.setShader(picturePattern->shader());
70 destContext->fillRect(destRect, destContext->fillColor(), compositeOp); 70 fillPaint.setColor(SK_ColorBLACK);
71 fillPaint.setXfermodeMode(compositeOp);
72
73 destContext->drawRect(destRect, fillPaint);
71 } 74 }
72 75
73 } // namespace blink 76 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698