diff options
-rw-r--r-- | example/HelloWorld.cpp | 1 | ||||
-rw-r--r-- | experimental/SkV8Example/SkV8Example.cpp | 1 | ||||
-rw-r--r-- | experimental/iOSSampleApp/Shared/SkUIView.mm | 9 | ||||
-rw-r--r-- | experimental/iOSSampleApp/SkSampleUIView.mm | 3 | ||||
-rw-r--r-- | include/views/SkWindow.h | 4 | ||||
-rw-r--r-- | samplecode/SampleApp.cpp | 3 | ||||
-rw-r--r-- | src/views/SkWindow.cpp | 20 | ||||
-rw-r--r-- | src/views/mac/SkNSView.mm | 3 | ||||
-rw-r--r-- | tools/VisualBench/VisualBench.cpp | 1 |
9 files changed, 15 insertions, 30 deletions
diff --git a/example/HelloWorld.cpp b/example/HelloWorld.cpp index c7c6bcd1dc..6833a33828 100644 --- a/example/HelloWorld.cpp +++ b/example/HelloWorld.cpp @@ -59,7 +59,6 @@ void HelloWorldWindow::setTitle() { } bool HelloWorldWindow::setUpBackend() { - this->setColorType(kRGBA_8888_SkColorType); this->setVisibleP(true); this->setClipToBounds(false); diff --git a/experimental/SkV8Example/SkV8Example.cpp b/experimental/SkV8Example/SkV8Example.cpp index 03a8826c88..fe205d740d 100644 --- a/experimental/SkV8Example/SkV8Example.cpp +++ b/experimental/SkV8Example/SkV8Example.cpp @@ -52,7 +52,6 @@ SkV8ExampleWindow::SkV8ExampleWindow(void* hwnd, JsContext* context) , fCurSurface(NULL) #endif { - this->setColorType(kBGRA_8888_SkColorType); this->setVisibleP(true); this->setClipToBounds(false); diff --git a/experimental/iOSSampleApp/Shared/SkUIView.mm b/experimental/iOSSampleApp/Shared/SkUIView.mm index e2dce54a69..df55619e4c 100644 --- a/experimental/iOSSampleApp/Shared/SkUIView.mm +++ b/experimental/iOSSampleApp/Shared/SkUIView.mm @@ -1,3 +1,9 @@ +/* + * Copyright 2011 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ #import "SkUIView.h" #include "SkCanvas.h" #include "SkCGUtils.h" @@ -29,8 +35,7 @@ - (void)setUpWindow { if (NULL != fWind) { fWind->setVisibleP(true); - fWind->resize(self.frame.size.width, self.frame.size.height, - kN32_SkColorType); + fWind->resize(self.frame.size.width, self.frame.size.height); } } diff --git a/experimental/iOSSampleApp/SkSampleUIView.mm b/experimental/iOSSampleApp/SkSampleUIView.mm index f2a8977d92..0c5209fa26 100644 --- a/experimental/iOSSampleApp/SkSampleUIView.mm +++ b/experimental/iOSSampleApp/SkSampleUIView.mm @@ -326,8 +326,7 @@ static FPSState gFPS; fDevManager = new SkiOSDeviceManager(fGL.fFramebuffer); fWind = new SampleWindow(self, argc, argv, fDevManager); - fWind->resize(self.frame.size.width, self.frame.size.height, - kN32_SkColorType); + fWind->resize(self.frame.size.width, self.frame.size.height); for (int i = 0; i < argc; ++i) { delete [] argv[i]; diff --git a/include/views/SkWindow.h b/include/views/SkWindow.h index 0d47875bf7..6db85a421c 100644 --- a/include/views/SkWindow.h +++ b/include/views/SkWindow.h @@ -43,8 +43,7 @@ public: const SkBitmap& getBitmap() const { return fBitmap; } - void setColorType(SkColorType); - void resize(int width, int height, SkColorType = kUnknown_SkColorType); + void resize(int width, int height); bool isDirty() const { return !fDirtyRgn.isEmpty(); } bool update(SkIRect* updateArea); @@ -96,7 +95,6 @@ protected: private: SkSurfaceProps fSurfaceProps; - SkColorType fColorType; SkBitmap fBitmap; SkRegion fDirtyRgn; diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index a3a81d8516..65e3c17a44 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -1982,9 +1982,6 @@ void SampleWindow::updateTitle() { title.prepend(gDeviceTypePrefix[fDeviceType]); - title.prepend(" "); - title.prepend(sk_tool_utils::colortype_name(this->getBitmap().colorType())); - if (fTilingMode != kNo_Tiling) { title.prependf("<T: %s> ", gTilingInfo[fTilingMode].label); } diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp index d93bc96a66..0e6da0b02d 100644 --- a/src/views/SkWindow.cpp +++ b/src/views/SkWindow.cpp @@ -20,7 +20,6 @@ SkWindow::SkWindow() { fClicks.reset(); fWaitingOnInval = false; - fColorType = kN32_SkColorType; fMatrix.reset(); } @@ -53,22 +52,13 @@ void SkWindow::postConcat(const SkMatrix& matrix) { this->setMatrix(m); } -void SkWindow::setColorType(SkColorType ct) { - this->resize(fBitmap.width(), fBitmap.height(), ct); -} - -void SkWindow::resize(int width, int height, SkColorType ct) { - if (ct == kUnknown_SkColorType) - ct = fColorType; - - if (width != fBitmap.width() || height != fBitmap.height() || ct != fColorType) { - fColorType = ct; - fBitmap.allocPixels(SkImageInfo::Make(width, height, - ct, kPremul_SkAlphaType)); - - this->setSize(SkIntToScalar(width), SkIntToScalar(height)); +void SkWindow::resize(int width, int height) { + if (width != fBitmap.width() || height != fBitmap.height()) { + fBitmap.allocPixels(SkImageInfo::Make(width, height, kN32_SkColorType, + kPremul_SkAlphaType)); this->inval(nullptr); } + this->setSize(SkIntToScalar(width), SkIntToScalar(height)); } bool SkWindow::handleInval(const SkRect* localR) { diff --git a/src/views/mac/SkNSView.mm b/src/views/mac/SkNSView.mm index a8376e62c9..ada79f8e14 100644 --- a/src/views/mac/SkNSView.mm +++ b/src/views/mac/SkNSView.mm @@ -56,8 +56,7 @@ static_assert(SK_SUPPORT_GPU, "not_implemented_for_non_gpu_build"); #if RETINA_API_AVAILABLE size = [self convertSizeToBacking:self.frame.size]; #endif - fWind->resize((int) size.width, (int) size.height, - kN32_SkColorType); + fWind->resize((int) size.width, (int) size.height); [[self window] setAcceptsMouseMovedEvents:YES]; } } diff --git a/tools/VisualBench/VisualBench.cpp b/tools/VisualBench/VisualBench.cpp index 476ac1654b..6d0268a708 100644 --- a/tools/VisualBench/VisualBench.cpp +++ b/tools/VisualBench/VisualBench.cpp @@ -86,7 +86,6 @@ SkSurface* VisualBench::createSurface() { } bool VisualBench::setupBackend() { - this->setColorType(kRGBA_8888_SkColorType); this->setVisibleP(true); this->setClipToBounds(false); |