Chromium Code Reviews| 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 "third_party/skia/include/core/SkShader.h" | 35 #include "third_party/skia/include/core/SkShader.h" |
| 36 #include <v8.h> | 36 #include <v8.h> |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 PassRefPtr<Pattern> Pattern::createImagePattern(PassRefPtr<Image> tileImage, Rep eatMode repeatMode) | 40 PassRefPtr<Pattern> Pattern::createImagePattern(PassRefPtr<Image> tileImage, Rep eatMode repeatMode) |
| 41 { | 41 { |
| 42 return ImagePattern::create(tileImage, repeatMode); | 42 return ImagePattern::create(tileImage, repeatMode); |
| 43 } | 43 } |
| 44 | 44 |
| 45 PassRefPtr<Pattern> Pattern::createPicturePattern(PassRefPtr<SkPicture> picture, | 45 PassRefPtr<Pattern> Pattern::createPicturePattern(sk_sp<SkPicture> picture, |
| 46 RepeatMode repeatMode) | 46 RepeatMode repeatMode) |
| 47 { | 47 { |
| 48 return PicturePattern::create(picture, repeatMode); | 48 return PicturePattern::create(picture, repeatMode); |
|
f(malita)
2016/09/01 03:55:38
std::move(picture)
Łukasz Anforowicz
2016/09/01 20:50:58
Done.
| |
| 49 } | 49 } |
| 50 | 50 |
| 51 Pattern::Pattern(RepeatMode repeatMode, int64_t externalMemoryAllocated) | 51 Pattern::Pattern(RepeatMode repeatMode, int64_t externalMemoryAllocated) |
| 52 : m_repeatMode(repeatMode) | 52 : m_repeatMode(repeatMode) |
| 53 , m_externalMemoryAllocated(0) | 53 , m_externalMemoryAllocated(0) |
| 54 { | 54 { |
| 55 adjustExternalMemoryAllocated(externalMemoryAllocated); | 55 adjustExternalMemoryAllocated(externalMemoryAllocated); |
| 56 } | 56 } |
| 57 | 57 |
| 58 Pattern::~Pattern() | 58 Pattern::~Pattern() |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 76 void Pattern::adjustExternalMemoryAllocated(int64_t delta) | 76 void Pattern::adjustExternalMemoryAllocated(int64_t delta) |
| 77 { | 77 { |
| 78 delta = std::max(-m_externalMemoryAllocated, delta); | 78 delta = std::max(-m_externalMemoryAllocated, delta); |
| 79 | 79 |
| 80 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(delta); | 80 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(delta); |
| 81 | 81 |
| 82 m_externalMemoryAllocated += delta; | 82 m_externalMemoryAllocated += delta; |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace blink | 85 } // namespace blink |
| OLD | NEW |