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

Side by Side Diff: cc/output/software_renderer.cc

Issue 1357423009: gfx: Make conversions from Size to SizeF be explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sizefconvert-gfx: . Created 5 years, 2 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 | « cc/output/renderer_pixeltest.cc ('k') | cc/output/software_renderer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/software_renderer.h" 5 #include "cc/output/software_renderer.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/compositor_frame_ack.h" 10 #include "cc/output/compositor_frame_ack.h"
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 512
513 SkMatrix content_mat; 513 SkMatrix content_mat;
514 content_mat.setRectToRect(content_rect, dest_rect, 514 content_mat.setRectToRect(content_rect, dest_rect,
515 SkMatrix::kFill_ScaleToFit); 515 SkMatrix::kFill_ScaleToFit);
516 516
517 const SkBitmap* content = lock.sk_bitmap(); 517 const SkBitmap* content = lock.sk_bitmap();
518 518
519 SkBitmap filter_bitmap; 519 SkBitmap filter_bitmap;
520 if (!quad->filters.IsEmpty()) { 520 if (!quad->filters.IsEmpty()) {
521 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter( 521 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter(
522 quad->filters, content_texture->size()); 522 quad->filters, gfx::SizeF(content_texture->size()));
523 // TODO(ajuma): Apply the filter in the same pass as the content where 523 // TODO(ajuma): Apply the filter in the same pass as the content where
524 // possible (e.g. when there's no origin offset). See crbug.com/308201. 524 // possible (e.g. when there's no origin offset). See crbug.com/308201.
525 filter_bitmap = ApplyImageFilter(filter.get(), quad, content); 525 filter_bitmap = ApplyImageFilter(filter.get(), quad, content);
526 } 526 }
527 527
528 skia::RefPtr<SkShader> shader; 528 skia::RefPtr<SkShader> shader;
529 if (filter_bitmap.isNull()) { 529 if (filter_bitmap.isNull()) {
530 shader = skia::AdoptRef(SkShader::CreateBitmapShader( 530 shader = skia::AdoptRef(SkShader::CreateBitmapShader(
531 *content, content_tile_mode, content_tile_mode, &content_mat)); 531 *content, content_tile_mode, content_tile_mode, &content_mat));
532 } else { 532 } else {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 724
725 SkMatrix filter_backdrop_transform = 725 SkMatrix filter_backdrop_transform =
726 contents_device_transform_inverse.matrix(); 726 contents_device_transform_inverse.matrix();
727 filter_backdrop_transform.preTranslate(backdrop_rect.x(), backdrop_rect.y()); 727 filter_backdrop_transform.preTranslate(backdrop_rect.x(), backdrop_rect.y());
728 728
729 // Draw what's behind, and apply the filter to it. 729 // Draw what's behind, and apply the filter to it.
730 SkBitmap backdrop_bitmap = GetBackdropBitmap(backdrop_rect); 730 SkBitmap backdrop_bitmap = GetBackdropBitmap(backdrop_rect);
731 731
732 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter( 732 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter(
733 quad->background_filters, 733 quad->background_filters,
734 gfx::Size(backdrop_bitmap.width(), backdrop_bitmap.height())); 734 gfx::SizeF(backdrop_bitmap.width(), backdrop_bitmap.height()));
735 SkBitmap filter_backdrop_bitmap = 735 SkBitmap filter_backdrop_bitmap =
736 ApplyImageFilter(filter.get(), quad, &backdrop_bitmap); 736 ApplyImageFilter(filter.get(), quad, &backdrop_bitmap);
737 737
738 if (filter_backdrop_bitmap.empty()) 738 if (filter_backdrop_bitmap.empty())
739 return skia::RefPtr<SkShader>(); 739 return skia::RefPtr<SkShader>();
740 740
741 return skia::AdoptRef(SkShader::CreateBitmapShader( 741 return skia::AdoptRef(SkShader::CreateBitmapShader(
742 filter_backdrop_bitmap, content_tile_mode, content_tile_mode, 742 filter_backdrop_bitmap, content_tile_mode, content_tile_mode,
743 &filter_backdrop_transform)); 743 &filter_backdrop_transform));
744 } 744 }
745 745
746 } // namespace cc 746 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/renderer_pixeltest.cc ('k') | cc/output/software_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698