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

Side by Side Diff: src/core/SkPaint.cpp

Issue 2337433002: fix code behind SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR (Closed)
Patch Set: Created 4 years, 3 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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkPaint.h" 8 #include "SkPaint.h"
9 #include "SkAutoKern.h" 9 #include "SkAutoKern.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 #ifdef SK_SUPPORT_LEGACY_PATHEFFECT_PTR 391 #ifdef SK_SUPPORT_LEGACY_PATHEFFECT_PTR
392 SET_PTR(PathEffect) 392 SET_PTR(PathEffect)
393 #endif 393 #endif
394 #ifdef SK_SUPPORT_LEGACY_MASKFILTER_PTR 394 #ifdef SK_SUPPORT_LEGACY_MASKFILTER_PTR
395 SET_PTR(MaskFilter) 395 SET_PTR(MaskFilter)
396 #endif 396 #endif
397 #undef SET_PTR 397 #undef SET_PTR
398 398
399 #ifdef SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR 399 #ifdef SK_SUPPORT_LEGACY_MINOR_EFFECT_PTR
400 SkDrawLooper* SkPaint::setLooper(SkDrawLooper* looper) { 400 SkDrawLooper* SkPaint::setLooper(SkDrawLooper* looper) {
401 fLooper.reset(SkSafeRef(looper)); 401 fDrawLooper.reset(SkSafeRef(looper));
402 return looper; 402 return looper;
403 } 403 }
404 #endif 404 #endif
405 405
406 SkXfermode* SkPaint::setXfermodeMode(SkXfermode::Mode mode) { 406 SkXfermode* SkPaint::setXfermodeMode(SkXfermode::Mode mode) {
407 fXfermode = SkXfermode::Make(mode); 407 fXfermode = SkXfermode::Make(mode);
408 return fXfermode.get(); // can/should we change this API to be void, like th e other setters? 408 return fXfermode.get(); // can/should we change this API to be void, like th e other setters?
409 } 409 }
410 410
411 /////////////////////////////////////////////////////////////////////////////// 411 ///////////////////////////////////////////////////////////////////////////////
(...skipping 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after
2385 } 2385 }
2386 2386
2387 uint32_t SkPaint::getHash() const { 2387 uint32_t SkPaint::getHash() const {
2388 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields, 2388 // We're going to hash 10 pointers and 7 32-bit values, finishing up with fB itfields,
2389 // so fBitfields should be 10 pointers and 6 32-bit values from the start. 2389 // so fBitfields should be 10 pointers and 6 32-bit values from the start.
2390 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo f(uint32_t), 2390 static_assert(offsetof(SkPaint, fBitfields) == 9 * sizeof(void*) + 6 * sizeo f(uint32_t),
2391 "SkPaint_notPackedTightly"); 2391 "SkPaint_notPackedTightly");
2392 return SkOpts::hash(reinterpret_cast<const uint32_t*>(this), 2392 return SkOpts::hash(reinterpret_cast<const uint32_t*>(this),
2393 offsetof(SkPaint, fBitfields) + sizeof(fBitfields)); 2393 offsetof(SkPaint, fBitfields) + sizeof(fBitfields));
2394 } 2394 }
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