Yes, tax brackets are based on the "Taxable income" line. The Qualified Dividends and Capital Gains Worksheet walks you through that process.
In a nutshell, you compute your regular income by subtracting your capital gains and qualified dividends from that taxable income line. You apply the regular tax brackets to this number. Then you apply the capital gains rate to the applicable portion of your income.
Remember that the regular income combines with capital gains income to determine your capital gains rate. If the sum of these is over $77k (or whatever the exact number is), further capital gains will be taxed at 15% regardless of what fraction of your first $77k was capital gains.