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

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

Issue 266633010: Use skia discardable memory for decoded images on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 { 77 {
78 return bitmap.pixelRef() 78 return bitmap.pixelRef()
79 && bitmap.pixelRef()->getURI() 79 && bitmap.pixelRef()->getURI()
80 && (!memcmp(bitmap.pixelRef()->getURI(), labelLazyDecoded, sizeof(labelL azyDecoded)) 80 && (!memcmp(bitmap.pixelRef()->getURI(), labelLazyDecoded, sizeof(labelL azyDecoded))
81 || !memcmp(bitmap.pixelRef()->getURI(), labelDiscardable, sizeof(lab elDiscardable))); 81 || !memcmp(bitmap.pixelRef()->getURI(), labelDiscardable, sizeof(lab elDiscardable)));
82 } 82 }
83 83
84 void DeferredImageDecoder::setEnabled(bool enabled) 84 void DeferredImageDecoder::setEnabled(bool enabled)
85 { 85 {
86 s_enabled = enabled; 86 s_enabled = enabled;
87 #if !OS(ANDROID) 87 // FIXME: Remove all non-discardable memory related code now that this is
88 // FIXME: This code is temporary to enable discardable memory for 88 // used on all platforms.
89 // non-Android platforms. In the future all platforms will be
90 // the same and we can remove this code.
91 s_skiaDiscardableMemoryEnabled = enabled; 89 s_skiaDiscardableMemoryEnabled = enabled;
92 if (enabled) 90 if (enabled)
93 ImageDecodingStore::setImageCachingEnabled(false); 91 ImageDecodingStore::setImageCachingEnabled(false);
94 #endif
95 } 92 }
96 93
97 bool DeferredImageDecoder::enabled() 94 bool DeferredImageDecoder::enabled()
98 { 95 {
99 return s_enabled; 96 return s_enabled;
100 } 97 }
101 98
102 String DeferredImageDecoder::filenameExtension() const 99 String DeferredImageDecoder::filenameExtension() const
103 { 100 {
104 return m_actualDecoder ? m_actualDecoder->filenameExtension() : m_filenameEx tension; 101 return m_actualDecoder ? m_actualDecoder->filenameExtension() : m_filenameEx tension;
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 return bitmap; 330 return bitmap;
334 } 331 }
335 332
336 bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const 333 bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const
337 { 334 {
338 // TODO: Implement. 335 // TODO: Implement.
339 return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false; 336 return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false;
340 } 337 }
341 338
342 } // namespace WebCore 339 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698