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

Side by Side Diff: cc/output/gl_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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 device_background_texture->Allocate( 855 device_background_texture->Allocate(
856 window_rect.size(), ResourceProvider::TextureUsageFramebuffer, RGBA_8888); 856 window_rect.size(), ResourceProvider::TextureUsageFramebuffer, RGBA_8888);
857 { 857 {
858 ResourceProvider::ScopedWriteLockGL lock(resource_provider_, 858 ResourceProvider::ScopedWriteLockGL lock(resource_provider_,
859 device_background_texture->id()); 859 device_background_texture->id());
860 GetFramebufferTexture( 860 GetFramebufferTexture(
861 lock.texture_id(), device_background_texture->format(), window_rect); 861 lock.texture_id(), device_background_texture->format(), window_rect);
862 } 862 }
863 863
864 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter( 864 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter(
865 quad->background_filters, device_background_texture->size()); 865 quad->background_filters, quad->scale, device_background_texture->size());
866 866
867 SkBitmap filtered_device_background; 867 SkBitmap filtered_device_background;
868 if (apply_background_filters) { 868 if (apply_background_filters) {
869 filtered_device_background = 869 filtered_device_background =
870 ApplyImageFilter(ScopedUseGrContext::Create(this, frame), 870 ApplyImageFilter(ScopedUseGrContext::Create(this, frame),
871 resource_provider_, 871 resource_provider_,
872 quad->rect.origin(), 872 quad->rect.origin(),
873 filter.get(), 873 filter.get(),
874 device_background_texture.get()); 874 device_background_texture.get());
875 } 875 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 SetBlendEnabled(true); 974 SetBlendEnabled(true);
975 } 975 }
976 976
977 // TODO(senorblanco): Cache this value so that we don't have to do it for both 977 // TODO(senorblanco): Cache this value so that we don't have to do it for both
978 // the surface and its replica. Apply filters to the contents texture. 978 // the surface and its replica. Apply filters to the contents texture.
979 SkBitmap filter_bitmap; 979 SkBitmap filter_bitmap;
980 SkScalar color_matrix[20]; 980 SkScalar color_matrix[20];
981 bool use_color_matrix = false; 981 bool use_color_matrix = false;
982 if (!quad->filters.IsEmpty()) { 982 if (!quad->filters.IsEmpty()) {
983 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter( 983 skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter(
984 quad->filters, contents_texture->size()); 984 quad->filters, quad->scale, contents_texture->size());
985 if (filter) { 985 if (filter) {
986 skia::RefPtr<SkColorFilter> cf; 986 skia::RefPtr<SkColorFilter> cf;
987 987
988 { 988 {
989 SkColorFilter* colorfilter_rawptr = NULL; 989 SkColorFilter* colorfilter_rawptr = NULL;
990 filter->asColorFilter(&colorfilter_rawptr); 990 filter->asColorFilter(&colorfilter_rawptr);
991 cf = skia::AdoptRef(colorfilter_rawptr); 991 cf = skia::AdoptRef(colorfilter_rawptr);
992 } 992 }
993 993
994 if (cf && cf->asColorMatrix(color_matrix) && !filter->getInput(0)) { 994 if (cf && cf->asColorMatrix(color_matrix) && !filter->getInput(0)) {
(...skipping 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after
3165 context_support_->ScheduleOverlayPlane( 3165 context_support_->ScheduleOverlayPlane(
3166 overlay.plane_z_order, 3166 overlay.plane_z_order,
3167 overlay.transform, 3167 overlay.transform,
3168 pending_overlay_resources_.back()->texture_id(), 3168 pending_overlay_resources_.back()->texture_id(),
3169 overlay.display_rect, 3169 overlay.display_rect,
3170 overlay.uv_rect); 3170 overlay.uv_rect);
3171 } 3171 }
3172 } 3172 }
3173 3173
3174 } // namespace cc 3174 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698