summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-17 17:45:53 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-17 17:45:53 +0000
commit524b2c17d0d22ff63c7b34abccf1682c08c9b7a0 (patch)
tree5cdf42866de03f03c96d22f2fdbe7ee6a607f275 /core/fxge
parentd99d5e3a34e18a771d62d449f379cb65bb54eee1 (diff)
downloadpdfium-524b2c17d0d22ff63c7b34abccf1682c08c9b7a0.tar.xz
Annotate CFX_ImageTransformer with LIKELY().
Doing this in the inner loops gets us another small performance improvement. Change-Id: I61fdf4bf8363a66123b3be3bc7ca9b5370f451fc Reviewed-on: https://pdfium-review.googlesource.com/32710 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/dib/cfx_imagetransformer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp
index 5067de4710..68867b5560 100644
--- a/core/fxge/dib/cfx_imagetransformer.cpp
+++ b/core/fxge/dib/cfx_imagetransformer.cpp
@@ -12,6 +12,7 @@
#include "core/fxge/dib/cfx_imagestretcher.h"
#include "core/fxge/fx_dib.h"
+#include "third_party/base/compiler_specific.h"
#include "third_party/base/numerics/safe_conversions.h"
#include "third_party/base/ptr_util.h"
@@ -488,7 +489,7 @@ void CFX_ImageTransformer::DoBilinearLoop(
d.src_row_l = 0;
matrix_fix.Transform(col, row, &d.src_col_l, &d.src_row_l, &d.res_x,
&d.res_y);
- if (InStretchBounds(d.src_col_l, d.src_row_l)) {
+ if (LIKELY(InStretchBounds(d.src_col_l, d.src_row_l))) {
AdjustCoords(&d.src_col_l, &d.src_row_l);
d.src_col_r = d.src_col_l + 1;
d.src_row_r = d.src_row_l + 1;
@@ -517,7 +518,7 @@ void CFX_ImageTransformer::DoBicubicLoop(
d.src_row_l = 0;
matrix_fix.Transform(col, row, &d.src_col_l, &d.src_row_l, &d.res_x,
&d.res_y);
- if (InStretchBounds(d.src_col_l, d.src_row_l)) {
+ if (LIKELY(InStretchBounds(d.src_col_l, d.src_row_l))) {
AdjustCoords(&d.src_col_l, &d.src_row_l);
bicubic_get_pos_weight(d.pos_pixel, d.u_w, d.v_w, d.src_col_l,
d.src_row_l, d.res_x, d.res_y, stretch_width(),
@@ -541,7 +542,7 @@ void CFX_ImageTransformer::DoDownSampleLoop(
d.src_col = 0;
d.src_row = 0;
matrix_fix.Transform(col, row, &d.src_col, &d.src_row);
- if (InStretchBounds(d.src_col, d.src_row)) {
+ if (LIKELY(InStretchBounds(d.src_col, d.src_row))) {
AdjustCoords(&d.src_col, &d.src_row);
func(d, dest);
}