| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 4 * Copyright (C) 2013 Google, Inc. All rights reserved. | 4 * Copyright (C) 2013 Google, Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "core/platform/graphics/Image.h" | 35 #include "core/platform/graphics/Image.h" |
| 36 #include "core/platform/graphics/skia/SkiaUtils.h" | 36 #include "core/platform/graphics/skia/SkiaUtils.h" |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace WebCore { |
| 39 | 39 |
| 40 Pattern::Pattern(PassRefPtr<Image> image, bool repeatX, bool repeatY) | 40 Pattern::Pattern(PassRefPtr<Image> image, bool repeatX, bool repeatY) |
| 41 : m_repeatX(repeatX) | 41 : m_repeatX(repeatX) |
| 42 , m_repeatY(repeatY) | 42 , m_repeatY(repeatY) |
| 43 , m_externalMemoryAllocated(0) | 43 , m_externalMemoryAllocated(0) |
| 44 { | 44 { |
| 45 ASSERT(image); | 45 if (image) { |
| 46 m_tileImage = image->nativeImageForCurrentFrame(); | 46 m_tileImage = image->nativeImageForCurrentFrame(); |
| 47 } |
| 47 } | 48 } |
| 48 | 49 |
| 49 Pattern::~Pattern() | 50 Pattern::~Pattern() |
| 50 { | 51 { |
| 51 if (m_externalMemoryAllocated) | 52 if (m_externalMemoryAllocated) |
| 52 v8::V8::AdjustAmountOfExternalAllocatedMemory(-m_externalMemoryAllocated
); | 53 v8::V8::AdjustAmountOfExternalAllocatedMemory(-m_externalMemoryAllocated
); |
| 53 } | 54 } |
| 54 | 55 |
| 55 SkShader* Pattern::shader() | 56 SkShader* Pattern::shader() |
| 56 { | 57 { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 95 } |
| 95 | 96 |
| 96 void Pattern::setPatternSpaceTransform(const AffineTransform& patternSpaceTransf
ormation) | 97 void Pattern::setPatternSpaceTransform(const AffineTransform& patternSpaceTransf
ormation) |
| 97 { | 98 { |
| 98 m_patternSpaceTransformation = patternSpaceTransformation; | 99 m_patternSpaceTransformation = patternSpaceTransformation; |
| 99 if (m_pattern) | 100 if (m_pattern) |
| 100 m_pattern->setLocalMatrix(affineTransformToSkMatrix(m_patternSpaceTransf
ormation)); | 101 m_pattern->setLocalMatrix(affineTransformToSkMatrix(m_patternSpaceTransf
ormation)); |
| 101 } | 102 } |
| 102 | 103 |
| 103 } | 104 } |
| OLD | NEW |