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

Side by Side Diff: sky/engine/platform/graphics/skia/NativeImageSkia.cpp

Issue 889823002: Remove TRACE_EVENT indirection through blink::Platform (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008, Google Inc. All rights reserved. 2 * Copyright (c) 2008, 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 130
131 SkBitmap NativeImageSkia::resizedBitmap(const SkISize& scaledImageSize, const Sk IRect& scaledImageSubset) const 131 SkBitmap NativeImageSkia::resizedBitmap(const SkISize& scaledImageSize, const Sk IRect& scaledImageSubset) const
132 { 132 {
133 ASSERT(!DeferredImageDecoder::isLazyDecoded(bitmap())); 133 ASSERT(!DeferredImageDecoder::isLazyDecoded(bitmap()));
134 134
135 if (!hasResizedBitmap(scaledImageSize, scaledImageSubset)) { 135 if (!hasResizedBitmap(scaledImageSize, scaledImageSubset)) {
136 bool shouldCache = isDataComplete() 136 bool shouldCache = isDataComplete()
137 && shouldCacheResampling(scaledImageSize, scaledImageSubset); 137 && shouldCacheResampling(scaledImageSize, scaledImageSubset);
138 138
139 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "ResizeImag e", "cached", shouldCache);
140 SkBitmap resizedImage = skia::ImageOperations::Resize(bitmap(), skia::Im ageOperations::RESIZE_LANCZOS3, scaledImageSize.width(), scaledImageSize.height( ), scaledImageSubset); 139 SkBitmap resizedImage = skia::ImageOperations::Resize(bitmap(), skia::Im ageOperations::RESIZE_LANCZOS3, scaledImageSize.width(), scaledImageSize.height( ), scaledImageSubset);
141 resizedImage.setImmutable(); 140 resizedImage.setImmutable();
142 141
143 if (!shouldCache) 142 if (!shouldCache)
144 return resizedImage; 143 return resizedImage;
145 144
146 m_resizedImage = resizedImage; 145 m_resizedImage = resizedImage;
147 } 146 }
148 147
149 SkBitmap resizedSubset; 148 SkBitmap resizedSubset;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 SkIRect NativeImageSkia::ImageResourceInfo::rectInSubset(const SkIRect& otherSca ledImageSubset) 361 SkIRect NativeImageSkia::ImageResourceInfo::rectInSubset(const SkIRect& otherSca ledImageSubset)
363 { 362 {
364 if (!scaledImageSubset.contains(otherScaledImageSubset)) 363 if (!scaledImageSubset.contains(otherScaledImageSubset))
365 return SkIRect::MakeEmpty(); 364 return SkIRect::MakeEmpty();
366 SkIRect subsetRect = otherScaledImageSubset; 365 SkIRect subsetRect = otherScaledImageSubset;
367 subsetRect.offset(-scaledImageSubset.x(), -scaledImageSubset.y()); 366 subsetRect.offset(-scaledImageSubset.x(), -scaledImageSubset.y());
368 return subsetRect; 367 return subsetRect;
369 } 368 }
370 369
371 } // namespace blink 370 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/platform/exported/WebConvertableToTraceFormat.cpp ('k') | sky/engine/platform/testing/RunAllTests.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698