Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2802)

Issue 5487050: Make static global initialization (flattening only) optional

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 4 months ago by caryclark1
Modified:
12 years, 4 months ago
Reviewers:
epoger, reed1
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Add a compile time option to choose between static global initializers used by flattening functions, and those same functions called once at flattening time. Add a dummy SkEffects_none.cpp so that tools can build Skia without including effects. Add a first cut at the SkGlobalInitialization port that Chromium might use. Add some missing flattening to ColorFilters and others.

Patch Set 1 #

Patch Set 2 : fix typos #

Total comments: 2

Patch Set 3 : fix chromium specific global initialization #

Patch Set 4 : more fixes for chromium globla initialization #

Patch Set 5 : more fixes for chromium global initialization (last upload didn't take) #

Patch Set 6 : more fixes for chromium global initialization (last upload didn't take) #

Patch Set 7 : remove patch piece that creates ports.gyp #

Patch Set 8 : make initialization manual #

Total comments: 2

Patch Set 9 : integrated InitGlobals() with Init() #

Patch Set 10 : added change to SkGraphics.cpp #

Unified diffs Side-by-side diffs Delta from patch set Stats (+403 lines, -118 lines) Patch
M gyp/effects.gyp View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M gyp/ports.gyp View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M gyp/tools.gyp View 1 2 3 4 5 6 3 chunks +3 lines, -0 lines 0 comments Download
M include/core/SkColorFilter.h View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M include/core/SkFlattenable.h View 1 2 3 4 5 6 2 chunks +39 lines, -0 lines 0 comments Download
M include/core/SkGraphics.h View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -1 line 0 comments Download
M include/core/SkMallocPixelRef.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkPathEffect.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkPixelRef.h View 1 2 3 4 5 6 2 chunks +23 lines, -0 lines 0 comments Download
M include/core/SkPostConfig.h View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M include/core/SkShape.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/core/SkXfermode.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M include/effects/Sk1DPathEffect.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/Sk2DPathEffect.h View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M include/effects/SkAvoidXfermode.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/SkBlurDrawLooper.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M include/effects/SkBlurImageFilter.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M include/effects/SkBlurMaskFilter.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/SkColorMatrixFilter.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/SkCornerPathEffect.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/SkDashPathEffect.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/SkDiscretePathEffect.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
A include/effects/SkEffects.h View 1 chunk +16 lines, -0 lines 0 comments Download
M include/effects/SkEmbossMaskFilter.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/SkGradientShader.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/SkGroupShape.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/SkLayerDrawLooper.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/SkLayerRasterizer.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/SkPixelXorXfermode.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/effects/SkRectShape.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M include/images/SkFlipPixelRef.h View 1 2 3 4 5 6 1 chunk +3 lines, -1 line 0 comments Download
M include/images/SkImageRef_GlobalPool.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M src/core/SkBitmapProcShader.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M src/core/SkBitmapProcShader.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M src/core/SkFlattenable.cpp View 1 2 3 4 5 6 7 3 chunks +16 lines, -1 line 0 comments Download
M src/core/SkGraphics.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M src/core/SkMallocPixelRef.cpp View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M src/core/SkPathEffect.cpp View 1 2 3 4 5 6 1 chunk +5 lines, -8 lines 0 comments Download
M src/core/SkPixelRef.cpp View 1 2 3 4 5 6 7 2 chunks +16 lines, -0 lines 0 comments Download
M src/core/SkShape.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkXfermode.cpp View 1 2 3 4 5 6 1 chunk +7 lines, -15 lines 0 comments Download
M src/effects/Sk1DPathEffect.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M src/effects/Sk2DPathEffect.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M src/effects/SkAvoidXfermode.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M src/effects/SkBlurDrawLooper.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M src/effects/SkBlurImageFilter.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M src/effects/SkBlurMaskFilter.cpp View 1 2 3 4 5 6 1 chunk +3 lines, -5 lines 0 comments Download
M src/effects/SkColorFilters.cpp View 1 2 3 4 5 6 12 chunks +36 lines, -33 lines 0 comments Download
M src/effects/SkColorMatrixFilter.cpp View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M src/effects/SkCornerPathEffect.cpp View 1 2 3 4 5 6 1 chunk +1 line, -4 lines 0 comments Download
M src/effects/SkDashPathEffect.cpp View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M src/effects/SkDiscretePathEffect.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
A src/effects/SkEffects.cpp View 1 chunk +53 lines, -0 lines 0 comments Download
A src/effects/SkEffects_none.cpp View 1 chunk +17 lines, -0 lines 0 comments Download
M src/effects/SkGradientShader.cpp View 1 2 3 4 5 6 2 chunks +8 lines, -10 lines 0 comments Download
M src/effects/SkGroupShape.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkLayerDrawLooper.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M src/effects/SkLayerRasterizer.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M src/effects/SkPixelXorXfermode.cpp View 1 2 3 4 5 6 1 chunk +1 line, -3 lines 0 comments Download
M src/effects/SkRectShape.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/images/SkFlipPixelRef.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
M src/images/SkImageRef_GlobalPool.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download
A src/ports/SkGlobalInitialization_chromium.cpp View 1 2 3 4 1 chunk +33 lines, -0 lines 0 comments Download
A src/ports/SkGlobalInitialization_default.cpp View 1 1 chunk +37 lines, -0 lines 0 comments Download
M src/ports/SkImageRef_ashmem.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M src/ports/SkImageRef_ashmem.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 14
caryclark1
12 years, 4 months ago (2011-12-12 21:26:46 UTC) #1
caryclark1
12 years, 4 months ago (2011-12-12 21:29:23 UTC) #2
epoger
clever... http://codereview.appspot.com/5487050/diff/1001/gyp/ports.gyp File gyp/ports.gyp (right): http://codereview.appspot.com/5487050/diff/1001/gyp/ports.gyp#newcode51 gyp/ports.gyp:51: # '../src/ports/SkFontHost_FreeType.cpp', what's with the commented- out lines ...
12 years, 4 months ago (2011-12-12 21:36:50 UTC) #3
caryclark1
http://codereview.appspot.com/5487050/diff/1001/gyp/ports.gyp File gyp/ports.gyp (right): http://codereview.appspot.com/5487050/diff/1001/gyp/ports.gyp#newcode51 gyp/ports.gyp:51: # '../src/ports/SkFontHost_FreeType.cpp', These lines were copied from core.gyp. I ...
12 years, 4 months ago (2011-12-12 21:58:03 UTC) #4
caryclark1
Here's what's required for this change to make a difference in Chromium: --- skia/skia.gyp (working ...
12 years, 4 months ago (2011-12-13 15:53:14 UTC) #5
caryclark1
I was mistaken: The Chromium build does not require SkEffects.cpp / SkEffects.h -- please ignore ...
12 years, 4 months ago (2011-12-13 16:38:45 UTC) #6
reed1
1. can we checkin anything unrelated to global initialization, like the ports gyp? Just trying ...
12 years, 4 months ago (2011-12-14 15:36:29 UTC) #7
caryclark1
On 2011/12/14 15:36:29, reed1 wrote: > 1. can we checkin anything unrelated to global initialization, ...
12 years, 4 months ago (2011-12-14 21:54:44 UTC) #8
reed1
I assume that it would be sufficient to do the following: - note that calling ...
12 years, 4 months ago (2011-12-14 22:01:33 UTC) #9
caryclark1
It looks like SkBitmap::flatten() does read the Registrar when it has a fPixelRef. Instead of ...
12 years, 4 months ago (2011-12-15 13:08:10 UTC) #10
caryclark1
12 years, 4 months ago (2011-12-15 13:52:40 UTC) #11
reed1
http://codereview.appspot.com/5487050/diff/9001/include/core/SkGraphics.h File include/core/SkGraphics.h (right): http://codereview.appspot.com/5487050/diff/9001/include/core/SkGraphics.h#newcode59 include/core/SkGraphics.h:59: #if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS Is this different from the caller's perspective ...
12 years, 4 months ago (2011-12-15 14:03:38 UTC) #12
caryclark1
http://codereview.appspot.com/5487050/diff/9001/include/core/SkGraphics.h File include/core/SkGraphics.h (right): http://codereview.appspot.com/5487050/diff/9001/include/core/SkGraphics.h#newcode59 include/core/SkGraphics.h:59: #if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS On 2011/12/15 14:03:38, reed1 wrote: > Is ...
12 years, 4 months ago (2011-12-15 14:13:42 UTC) #13
reed1
12 years, 4 months ago (2011-12-15 14:14:48 UTC) #14
lgtm
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b