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

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

Issue 317663005: Scale the ALPHA_THRESHOLD filter's region based on the device scale factor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use SkMatrix when creating AlphaFilter Created 6 years, 5 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 | Annotate | Revision Log
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/debug/trace_event.h" 7 #include "base/debug/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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 516
517 SkMatrix content_mat; 517 SkMatrix content_mat;
518 content_mat.setRectToRect(content_rect, dest_rect, 518 content_mat.setRectToRect(content_rect, dest_rect,
519 SkMatrix::kFill_ScaleToFit); 519 SkMatrix::kFill_ScaleToFit);
520 520
521 const SkBitmap* content = lock.sk_bitmap(); 521 const SkBitmap* content = lock.sk_bitmap();
522 522
523 SkBitmap filter_bitmap; 523 SkBitmap filter_bitmap;
524 if (!quad->filters.IsEmpty()) { 524 if (!quad->filters.IsEmpty()) {
525 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter( 525 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter(
526 quad->filters, content_texture->size()); 526 quad->filters, quad->scale, content_texture->size());
527 // TODO(ajuma): In addition origin translation, the canvas should also be 527 // TODO(ajuma): In addition origin translation, the canvas should also be
528 // scaled to accomodate device pixel ratio and pinch zoom. See 528 // scaled to accomodate device pixel ratio and pinch zoom. See
529 // crbug.com/281516 and crbug.com/281518. 529 // crbug.com/281516 and crbug.com/281518.
530 // TODO(ajuma): Apply the filter in the same pass as the content where 530 // TODO(ajuma): Apply the filter in the same pass as the content where
531 // possible (e.g. when there's no origin offset). See crbug.com/308201. 531 // possible (e.g. when there's no origin offset). See crbug.com/308201.
532 if (filter) { 532 if (filter) {
533 SkImageInfo info = SkImageInfo::MakeN32Premul( 533 SkImageInfo info = SkImageInfo::MakeN32Premul(
534 content_texture->size().width(), content_texture->size().height()); 534 content_texture->size().width(), content_texture->size().height());
535 if (filter_bitmap.allocPixels(info)) { 535 if (filter_bitmap.allocPixels(info)) {
536 SkCanvas canvas(filter_bitmap); 536 SkCanvas canvas(filter_bitmap);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 } 644 }
645 645
646 void SoftwareRenderer::DidChangeVisibility() { 646 void SoftwareRenderer::DidChangeVisibility() {
647 if (visible()) 647 if (visible())
648 EnsureBackbuffer(); 648 EnsureBackbuffer();
649 else 649 else
650 DiscardBackbuffer(); 650 DiscardBackbuffer();
651 } 651 }
652 652
653 } // namespace cc 653 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698